|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.berkeley.nlp.lm.io.KneserNeyFileWritingLmReaderCallback<W>
W
- public class KneserNeyFileWritingLmReaderCallback<W>
Class for producing a Kneser-Ney language model in ARPA format from raw text.
Constructor Summary | |
---|---|
KneserNeyFileWritingLmReaderCallback(File outputFile,
WordIndexer<W> wordIndexer)
|
|
KneserNeyFileWritingLmReaderCallback(PrintWriter out,
WordIndexer<W> wordIndexer)
|
Method Summary | |
---|---|
void |
call(int[] ngram,
int startPos,
int endPos,
ProbBackoffPair value,
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(List<Long> numNGrams)
Called initially with a list of how many n-grams will appear for each order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KneserNeyFileWritingLmReaderCallback(File outputFile, WordIndexer<W> wordIndexer)
public KneserNeyFileWritingLmReaderCallback(PrintWriter out, WordIndexer<W> wordIndexer)
Method Detail |
---|
public void handleNgramOrderFinished(int order)
NgramOrderedLmReaderCallback
handleNgramOrderFinished
in interface NgramOrderedLmReaderCallback<ProbBackoffPair>
public void handleNgramOrderStarted(int order)
NgramOrderedLmReaderCallback
handleNgramOrderStarted
in interface NgramOrderedLmReaderCallback<ProbBackoffPair>
public void call(int[] ngram, int startPos, int endPos, ProbBackoffPair value, String words)
LmReaderCallback
call
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()
LmReaderCallback
cleanup
in interface LmReaderCallback<ProbBackoffPair>
public void initWithLengths(List<Long> numNGrams)
ArpaLmReaderCallback
initWithLengths
in interface ArpaLmReaderCallback<ProbBackoffPair>
numNGrams
- maps n-gram orders to number of n-grams (i.e. numNGrams.get(0)
is the number of unigrams)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |