Class BaseLanguageModel

    • Field Detail

      • totalTokenCount

        private java.lang.Long totalTokenCount
    • Constructor Detail

      • BaseLanguageModel

        public BaseLanguageModel()
    • Method Detail

      • tryGetCount

        private long tryGetCount​(java.util.List<java.lang.String> context)
      • getPseudoProbabilityStupidBackoff

        public Probability getPseudoProbabilityStupidBackoff​(java.util.List<java.lang.String> context)
      • getPseudoProbability

        public Probability getPseudoProbability​(java.util.List<java.lang.String> context)
        Description copied from interface: LanguageModel
        This is not always guaranteed to be a real probability (0.0 to 1.0). Throws exception if context is longer than the ngram index supports.
        Specified by:
        getPseudoProbability in interface LanguageModel
      • getCount

        public abstract long getCount​(java.lang.String token1)
        Get the occurrence count for token.
      • getCount

        public abstract long getCount​(java.util.List<java.lang.String> tokens)
        Get the occurrence count for the given token sequence.
      • getTotalTokenCount

        public abstract long getTotalTokenCount()
      • debug

        private void debug​(java.lang.String message,
                           java.lang.Object... vars)