src/language model based query topic analysis/src/edu/virginia/cs/model/GenerateCoverQuery.java
private String generateCoverQuery(int queryLength, int bucketNum, int level, int trueQuTopic, boolean fromSibling, int coverQuTopic) {
        int coverQuLen = getPoisson(queryLength);
        if (coverQuLen == 0) {
            return null;
        }
        String coverQ;
        switch (coverQuLen) {
            case 1:
                coverQ = getCQfromUnigramLM(level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
            case 2:
                coverQ = getCQfromBigramLM(level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
            case 3:
                coverQ = getCQfromTrigramLM(level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
            case 4:
                coverQ = getCQfromFourgramLM(level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
            default:
                coverQ = getCQfromNgramLM(coverQuLen, level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
        }
        return coverQ;
    }
/**
     * Creates a cover query based on the original user query length. Unigram,
     * bigram, trigram and fourgram language models are used to generate cover
     * queries of length 1, 2, 3 and 4 respectively. Cover queries of length
     * greater than 4 are created by a special procedure.
     *
     * @param queryLength
     * @param bucketNum
     * @param level
     * @param trueQuTopic
     * @param fromSibling
     * @param coverQuTopic
     */
Creates a cover query based on the original user query length. Unigram,
bigram, trigram and fourgram language models are used to generate cover
queries of length 1, 2, 3 and 4 respectively. Cover queries of length
greater than 4 are created by a special procedure.


Creates a cover query based on the original user query length . Unigram bigram trigram and fourgram language models are used to generate cover queries of length 1 2 3 and 4 respectively . Cover queries of length greater than 4 are created by a special procedure .
private String generateCoverQuery(int queryLength, int bucketNum, int level, int trueQuTopic, boolean fromSibling, int coverQuTopic) {
        int coverQuLen = getPoisson(queryLength);
        if (coverQuLen == 0) {
            return null;
        }
        String coverQ;
        switch (coverQuLen) {
            case 1:
                coverQ = getCQfromUnigramLM(level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
            case 2:
                coverQ = getCQfromBigramLM(level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
            case 3:
                coverQ = getCQfromTrigramLM(level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
            case 4:
                coverQ = getCQfromFourgramLM(level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
            default:
                coverQ = getCQfromNgramLM(coverQuLen, level, bucketNum, trueQuTopic, fromSibling, coverQuTopic);
                break;
        }
        return coverQ;
    }
private String generateCoverQuery ( int queryLength , int bucketNum , int level , int trueQuTopic , boolean fromSibling , int coverQuTopic ) { int coverQuLen = getPoisson ( queryLength ) ; if ( coverQuLen == 0 ) { return null ; } String coverQ ; switch ( coverQuLen ) { case 1 : coverQ = getCQfromUnigramLM ( level , bucketNum , trueQuTopic , fromSibling , coverQuTopic ) ; break ; case 2 : coverQ = getCQfromBigramLM ( level , bucketNum , trueQuTopic , fromSibling , coverQuTopic ) ; break ; case 3 : coverQ = getCQfromTrigramLM ( level , bucketNum , trueQuTopic , fromSibling , coverQuTopic ) ; break ; case 4 : coverQ = getCQfromFourgramLM ( level , bucketNum , trueQuTopic , fromSibling , coverQuTopic ) ; break ; default : coverQ = getCQfromNgramLM ( coverQuLen , level , bucketNum , trueQuTopic , fromSibling , coverQuTopic ) ; break ; } return coverQ ; }
Creates a cover query based on the original user query length.
Creates a cover query based on the original user query length .