Interface LanguageModel

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
BaseLanguageModel, LuceneLanguageModel, LuceneSingleIndexLanguageModel, MockLanguageModel, MultiLanguageModel

public interface LanguageModel extends AutoCloseable
A language model that provides information about ngram probabilities. The implementations don't necessarily deal well with the occurrence = 0 case.
Since:
2.7
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    ngram sentence end marker - note: this is not in the v1 data from Google
    static final String
    ngram sentence start marker - note: this is not in the v1 data from Google
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    This is not always guaranteed to be a real probability (0.0 to 1.0).
  • Field Details

    • GOOGLE_SENTENCE_START

      static final String GOOGLE_SENTENCE_START
      ngram sentence start marker - note: this is not in the v1 data from Google
      See Also:
    • GOOGLE_SENTENCE_END

      static final String GOOGLE_SENTENCE_END
      ngram sentence end marker - note: this is not in the v1 data from Google
      See Also:
  • Method Details

    • getPseudoProbability

      Probability getPseudoProbability(List<String> context)
      This is not always guaranteed to be a real probability (0.0 to 1.0). Throws exception if context is longer than the ngram index supports.
      Since:
      3.2
    • close

      void close()
      Specified by:
      close in interface AutoCloseable