W - public class KneserNeyFileWritingLmReaderCallback<W> extends java.lang.Object implements ArpaLmReaderCallback<ProbBackoffPair>
| Constructor and Description |
|---|
KneserNeyFileWritingLmReaderCallback(java.io.File outputFile,
WordIndexer<W> wordIndexer) |
KneserNeyFileWritingLmReaderCallback(java.io.PrintWriter out,
WordIndexer<W> wordIndexer) |
| Modifier and Type | Method and Description |
|---|---|
void |
call(int[] ngram,
int startPos,
int endPos,
ProbBackoffPair value,
java.lang.String words)
Called for each n-gram
|
void |
cleanup()
Called once all reading is done.
|
void |
handleNgramOrderFinished(int order)
Called when all n-grams of a given order are finished
|
void |
handleNgramOrderStarted(int order)
Called when n-grams of a given order are started
|
void |
initWithLengths(java.util.List<java.lang.Long> numNGrams)
Called initially with a list of how many n-grams will appear for each
order.
|
public KneserNeyFileWritingLmReaderCallback(java.io.File outputFile,
WordIndexer<W> wordIndexer)
public KneserNeyFileWritingLmReaderCallback(java.io.PrintWriter out,
WordIndexer<W> wordIndexer)
public void handleNgramOrderFinished(int order)
NgramOrderedLmReaderCallbackhandleNgramOrderFinished in interface NgramOrderedLmReaderCallback<ProbBackoffPair>public void handleNgramOrderStarted(int order)
NgramOrderedLmReaderCallbackhandleNgramOrderStarted in interface NgramOrderedLmReaderCallback<ProbBackoffPair>public void call(int[] ngram,
int startPos,
int endPos,
ProbBackoffPair value,
java.lang.String words)
LmReaderCallbackcall in interface LmReaderCallback<ProbBackoffPair>ngram - The integer representation of the words as given by the
provided WordIndexervalue - The value of the n-gramwords - The string representation of the n-gram (space separated)public void cleanup()
LmReaderCallbackcleanup in interface LmReaderCallback<ProbBackoffPair>public void initWithLengths(java.util.List<java.lang.Long> numNGrams)
ArpaLmReaderCallbackinitWithLengths in interface ArpaLmReaderCallback<ProbBackoffPair>numNGrams - maps n-gram orders to number of n-grams (i.e. numNGrams.get(0)
is the number of unigrams)