Class 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • prob

        private final double prob
      • coverage

        private final float coverage
      • occurrences

        private final long occurrences
    • Constructor Detail

      • Probability

        public Probability​(double prob,
                           float coverage,
                           long occurrences)
      • Probability

        public Probability​(double prob,
                           float coverage)
    • 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 class java.lang.Object