Package org.languagetool.rules.ngrams
Class Probability
java.lang.Object
org.languagetool.rules.ngrams.Probability
Probability, but doesn't check for a range of 0 to 1.
- Since:
- 3.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float
private final long
private final double
-
Constructor Summary
ConstructorsConstructorDescriptionProbability
(double prob, float coverage) Probability
(double prob, float coverage, long occurrences) -
Method Summary
-
Field Details
-
prob
private final double prob -
coverage
private final float coverage -
occurrences
private final long occurrences
-
-
Constructor Details
-
Probability
public Probability(double prob, float coverage, long occurrences) -
Probability
public Probability(double prob, float coverage)
-
-
Method Details
-
getProb
public double getProb()A probability-like value, but can be filled with any float >= 0. -
getLogProb
public double getLogProb() -
getCoverage
public float getCoverage()The fraction of lookups that had occurrence counts > 0. This might be used to ignore the whole probability for low coverage items. -
getOccurrences
public long getOccurrences()The number the longest ngram occurs in the corpus. Maybe be -1 if not known. -
toString
-