Class KneserNeyFileWritingLmReaderCallback<W>

    • Constructor Detail

      • KneserNeyFileWritingLmReaderCallback

        public KneserNeyFileWritingLmReaderCallback​(java.io.File outputFile,
                                                    WordIndexer<W> wordIndexer)
      • KneserNeyFileWritingLmReaderCallback

        public KneserNeyFileWritingLmReaderCallback​(java.io.PrintWriter out,
                                                    WordIndexer<W> wordIndexer)
    • Method Detail

      • call

        public void call​(int[] ngram,
                         int startPos,
                         int endPos,
                         ProbBackoffPair value,
                         java.lang.String words)
        Description copied from interface: LmReaderCallback
        Called for each n-gram
        Specified by:
        call in interface LmReaderCallback<W>
        Parameters:
        ngram - The integer representation of the words as given by the provided WordIndexer
        value - The value of the n-gram
        words - The string representation of the n-gram (space separated)
      • initWithLengths

        public void initWithLengths​(java.util.List<java.lang.Long> numNGrams)
        Description copied from interface: ArpaLmReaderCallback
        Called initially with a list of how many n-grams will appear for each order.
        Specified by:
        initWithLengths in interface ArpaLmReaderCallback<W>
        Parameters:
        numNGrams - maps n-gram orders to number of n-grams (i.e. numNGrams.get(0) is the number of unigrams)