#include <ArpaReader.hh>
Public Member Functions | |
ArpaReader (FILE *file=NULL) | |
Construct a reader associated with a possible file. | |
void | reset (FILE *file) |
Reset the structure and prepare reading from file. | |
void | read_header () |
Read the header of the ARPA file. | |
bool | read_ngram () |
Read next ngram from the ARPA file. | |
bool | read_order_ngrams (bool sort=false) |
Read all ngrams of the next order. | |
Public Attributes | |
bit::ArpaReader::Options | opt |
Configurable options. | |
bit::ArpaReader::Header | header |
Information in the ARPA header. | |
bit::ArpaReader::Ngram | ngram |
The ngram read at the last call of read_ngram(). | |
std::vector< Ngram > | order_ngrams |
Ngrams read with read_order_ngrams(). | |
std::vector< int > | sorted_order |
Indices of sorted ngrams. | |
SymbolMap< std::string, int > | symbol_map |
The symbols in the model. | |
bool | end_reached |
Have we reached the \ keyword. | |
Private Attributes | |
FILE * | m_file |
The file to read from. | |
int | m_current_order |
The order ngram just read from the file. | |
int | m_ngrams_read |
The number of ngrams read for current order. | |
Classes | |
struct | Header |
Information in the ARPA header. More... | |
struct | Ngram |
The ngram read at the last call of read_ngram(). More... | |
struct | Options |
Configurable options. More... |
The following events are treated as error:
The following events are accepted silently:
|
Construct a reader associated with a possible file.
|
|
Read the header of the ARPA file.
|
|
Read next ngram from the ARPA file.
|
|
Read all ngrams of the next order.
|
|
Reset the structure and prepare reading from file.
|
|
Have we reached the \ keyword.
|
|
Information in the ARPA header.
|
|
The order ngram just read from the file.
|
|
The file to read from.
|
|
The number of ngrams read for current order.
|
|
The ngram read at the last call of read_ngram().
|
|
Configurable options.
|
|
Ngrams read with read_order_ngrams().
|
|
Indices of sorted ngrams.
|
|
The symbols in the model.
|