Package edu.berkeley.nlp.lm.io
Class ArpaLmReader<W>
java.lang.Object
edu.berkeley.nlp.lm.io.ArpaLmReader<W>
- All Implemented Interfaces:
LmReader<ProbBackoffPair,
ArpaLmReaderCallback<ProbBackoffPair>>
public class ArpaLmReader<W>
extends Object
implements LmReader<ProbBackoffPair,ArpaLmReaderCallback<ProbBackoffPair>>
A parser for ARPA LM files.
- Author:
- Alex Bouchard-Cote, Adam Pauls
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
parse
(ArpaLmReaderCallback<ProbBackoffPair> callback) Parse the ARPA file and populate the relevant fields of the enclosing ICSILanguageModelprotected void
parseNGrams
(ArpaLmReaderCallback<ProbBackoffPair> callback) protected String
readLine()
-
Field Details
-
START_SYMBOL
- See Also:
-
END_SYMBOL
- See Also:
-
UNK_SYMBOL
- See Also:
-
-
Constructor Details
-
ArpaLmReader
- Parameters:
reader
-
-
-
Method Details
-
readLine
- Returns:
- Throws:
IOException
-
parse
Parse the ARPA file and populate the relevant fields of the enclosing ICSILanguageModel- Specified by:
parse
in interfaceLmReader<ProbBackoffPair,
ArpaLmReaderCallback<ProbBackoffPair>>
-
parseHeader
- Parameters:
callback
-- Throws:
IOException
ARPAParserException
-
parseNGrams
-