Class Probability

java.lang.Object
org.languagetool.rules.ngrams.Probability

public class Probability extends Object
Probability, but doesn't check for a range of 0 to 1.
Since:
3.2
  • 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

      public String toString()
      Overrides:
      toString in class Object