Interface ArrayEncodedNgramLanguageModel<W>

    • Method Detail

      • getLogProb

        float getLogProb​(int[] ngram,
                         int startPos,
                         int endPos)
        Calculate language model score of an n-gram. Warning: if you pass in an n-gram of length greater than getLmOrder(), this call will silently ignore the extra words of context. In other words, if you pass in a 5-gram (endPos-startPos == 5) to a 3-gram model, it will only score the words from startPos + 2 to endPos.
        Parameters:
        ngram - array of words in integer representation
        startPos - start of the portion of the array to be read
        endPos - end of the portion of the array to be read.
        Returns: