public class ArpaLmReader<W> extends Object implements LmReader<ProbBackoffPair,ArpaLmReaderCallback<ProbBackoffPair>>
Modifier and Type | Field and Description |
---|---|
static String |
END_SYMBOL |
static String |
START_SYMBOL |
static String |
UNK_SYMBOL |
Constructor and Description |
---|
ArpaLmReader(String file,
WordIndexer<W> wordIndexer,
int maxNgramOrder) |
Modifier and Type | Method and Description |
---|---|
void |
parse(ArpaLmReaderCallback<ProbBackoffPair> callback)
Parse the ARPA file and populate the relevant fields of the enclosing
ICSILanguageModel
|
protected List<Long> |
parseHeader() |
protected void |
parseNGrams(ArpaLmReaderCallback<ProbBackoffPair> callback) |
protected String |
readLine() |
public static final String START_SYMBOL
public static final String END_SYMBOL
public static final String UNK_SYMBOL
public ArpaLmReader(String file, WordIndexer<W> wordIndexer, int maxNgramOrder)
reader
- protected String readLine() throws IOException
IOException
public void parse(ArpaLmReaderCallback<ProbBackoffPair> callback)
parse
in interface LmReader<ProbBackoffPair,ArpaLmReaderCallback<ProbBackoffPair>>
protected List<Long> parseHeader()
callback
- IOException
ARPAParserException
protected void parseNGrams(ArpaLmReaderCallback<ProbBackoffPair> callback)