edu.berkeley.nlp.lm.phrasetable
Class MosesPhraseTableReaderCallback<W>
java.lang.Object
edu.berkeley.nlp.lm.phrasetable.MosesPhraseTableReaderCallback<W>
- Type Parameters:
W
-
- All Implemented Interfaces:
- LmReaderCallback<PhraseTableCounts>
public class MosesPhraseTableReaderCallback<W>
- extends Object
- implements LmReaderCallback<PhraseTableCounts>
Class for representing phrase tables efficiently in memory.
- Author:
- adampauls
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MosesPhraseTableReaderCallback
public MosesPhraseTableReaderCallback(WordIndexer<W> wordIndexer)
call
public void call(int[] ngram,
int startPos,
int endPos,
PhraseTableCounts value,
String words)
- Description copied from interface:
LmReaderCallback
- Called for each n-gram
- Specified by:
call
in interface LmReaderCallback<PhraseTableCounts>
- Parameters:
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)
cleanup
public void cleanup()
- Description copied from interface:
LmReaderCallback
- Called once all reading is done.
- Specified by:
cleanup
in interface LmReaderCallback<PhraseTableCounts>
getMap
public HashNgramMap<PhraseTableValueContainer.PhraseTableValues> getMap()