quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_mmedia.a #include <NGramParser.h> boolean setOrder(long order); long getOrder() const; boolean load(Sof& sof, HashTable<Long, NGramNode>& gram_hash, const Vector<String>& symbol_table, const long& tag, const String& name); boolean NGramParser::store(Sof& file, const HashTable<Long, NGramNode>& gram_hash, const Vector<String>& symbol_table, const long& tag, const String& name) const;
description:Sof tmp_sof; String file_name; Vectorsymbol_table; HashTable gram_hash; file_name.assign(L"tidigits_trigram.arpa"); tmp_sof.open(file_name, File::READ_ONLY); NGramParser np_00; np_00.load(tmp_sof, gram_hash, symbol_table, 1, L"NGramModel"); tmp_sof.close();
static const String CLASS_NAME;
enum FORMAT { NGRAM_ARPA = 0, DEF_FORMAT = NGRAM_ARPA };
static const long DEF_ORDER = (long)0;
static const long ERR = 50600;
static const long ERR_ORDER = 50601;
static const long ERR_TAG = 506012;
static const long ERR_SYMBOL = 50603;
static const long ERR_HASH = 50604;
static const long ERR_FORMAT = 50605;
static const long ERR_NUM_GRAM = 50606;
long order_d;
static Integral::DEBUG debug_level_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* msg) const;
static boolean setDebug(Integral::DEBUG debug_level);
~NGramParser();
NGramParser(long order = DEF_ORDER);
boolean assign(const NGramParser& arg);
NGramParser& operator= (const NGramParser& arg);
long sofSize() const;
boolean read(Sof& sof, const long& tag, const String& cname = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& cname = CLASS_NAME) const;
boolean eq(const NGramParser& arg) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);
boolean setOrder(long order);
long getOrder() const;
boolean load(Sof& sof, HashTable<Long, NGramNode>& gram_hash, const Vector<String>& symbol_table, const long& tag, const String& name);
boolean NGramParser::store(Sof& file, const HashTable<Long, NGramNode>& gram_hash, const Vector<String>& symbol_table, const long& tag, const String& name) const;
boolean storeToHash(HashTable<Long, NGramNode>& gram_hash, SingleLinkedList<NGramNode>& symbol_list, NGramNode* prefix_node);