name: NGramModel

synopsis:
g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_stat.a

#include <NGramModel.h>

~NGramModel();
NGramModel();
NGramModel(const NGramModel& copy_sym);

boolean load(Sof& sof, const long& tag, const Vector& symbol_table,
             const String& name = CLASS_NAME);
boolean getScore(const VectorLong& index_a, float& score_a);
boolean setOrder(long order);

quick start:
#include <NGramModel.h>

// configure ngram object and load a trigram file
//
NGramModel ngrm;
ngrm.setOrder(3);
ngrm.load(sof, 1, symbol_table);
sof.close();

// test getScore
//
String symb1(L"ONE"), symb2(L"TWO"), symb3(L"FOUR");
VectorLong index(2);

// get a bigram (ONE TWO) probability
//
index(0) = *symbol_hash.get(symb1);
index(1) = *symbol_hash.get(symb2);

float score = ngrm.getScore(index);

description:

NGramModel is a class that manages N-gram probabilities, such as bigram, trigram, etc. This class can be used to load an input N-gram file, such as NIST_ARPA grammar file, and then store it to HashTable for lookup.

dependencies:

public constants:

error codes:

protected data:

required public methods:

class-specific public methods:

private methods:

examples:

notes: