public final class LanguageModelUtils extends Object
Modifier and Type | Method and Description |
---|---|
static double |
get3gramProbabilityFor(Language lang,
LanguageModel lm,
int position,
AnalyzedSentence sentence,
String candidate) |
static double |
get4gramProbabilityFor(Language lang,
LanguageModel lm,
int position,
AnalyzedSentence sentence,
String candidate) |
static <T> List<T> |
getContext(T token,
List<T> tokens,
List<T> newTokens,
int toLeft,
int toRight,
Predicate<T> isWhitespace,
T endToken) |
public static <T> List<T> getContext(T token, List<T> tokens, List<T> newTokens, int toLeft, int toRight, Predicate<T> isWhitespace, T endToken)
public static double get3gramProbabilityFor(Language lang, LanguageModel lm, int position, AnalyzedSentence sentence, String candidate)
public static double get4gramProbabilityFor(Language lang, LanguageModel lm, int position, AnalyzedSentence sentence, String candidate)