Package org.languagetool.rules.ngrams
Class Probability
- java.lang.Object
-
- org.languagetool.rules.ngrams.Probability
-
public class Probability extends java.lang.Object
Probability, but doesn't check for a range of 0 to 1.- Since:
- 3.2
-
-
Field Summary
Fields Modifier and Type Field Description private float
coverage
private long
occurrences
private double
prob
-
Constructor Summary
Constructors Constructor Description Probability(double prob, float coverage)
Probability(double prob, float coverage, long occurrences)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getCoverage()
The fraction of lookups that had occurrence counts > 0.double
getLogProb()
long
getOccurrences()
The number the longest ngram occurs in the corpus.double
getProb()
A probability-like value, but can be filled with any float >= 0.java.lang.String
toString()
-
-
-
Method Detail
-
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-