Package org.languagetool.languagemodel
Interface LanguageModel
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
BaseLanguageModel
,LuceneLanguageModel
,LuceneSingleIndexLanguageModel
,MockLanguageModel
,MultiLanguageModel
public interface LanguageModel extends java.lang.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 java.lang.String
GOOGLE_SENTENCE_END
ngram sentence end marker - note: this is not in the v1 data from Googlestatic java.lang.String
GOOGLE_SENTENCE_START
ngram sentence start marker - note: this is not in the v1 data from Google
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Probability
getPseudoProbability(java.util.List<java.lang.String> context)
This is not always guaranteed to be a real probability (0.0 to 1.0).
-
-
-
Field Detail
-
GOOGLE_SENTENCE_START
static final java.lang.String GOOGLE_SENTENCE_START
ngram sentence start marker - note: this is not in the v1 data from Google- See Also:
- Constant Field Values
-
GOOGLE_SENTENCE_END
static final java.lang.String GOOGLE_SENTENCE_END
ngram sentence end marker - note: this is not in the v1 data from Google- See Also:
- Constant Field Values
-
-
Method Detail
-
getPseudoProbability
Probability getPseudoProbability(java.util.List<java.lang.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 interfacejava.lang.AutoCloseable
-
-