TRF Language Model
|
#include <trf-vocab.h>
Public Member Functions | |
Vocab () | |
Vocab (const char *pathVocab) | |
~Vocab () | |
int | GetSize () |
get the vocab size, i.e. the word number More... | |
int | GetClassNum () |
get the total class number More... | |
const char * | GetWordStr (int id) |
get word string More... | |
VocabID * | GetClassMap () |
get class map More... | |
VocabID | GetClass (VocabID wid) |
get class More... | |
void | GetClass (VocabID *pcid, const VocabID *pwid, int nlen) |
get classes of a word sequence More... | |
VocabID | RandClass () |
random a class More... | |
Array< int > * | GetWord (VocabID cid) |
get word belonging to a class More... | |
int | IterBeg () const |
iter all the words, regardless the beg/end symbols More... | |
int | IterEnd () const |
iter all the words, regardless the beg/end symbols More... | |
bool | IsLegalWord (VocabID id) const |
Check if the VocabID is a legal word. More... | |
Public Attributes | |
Array< VocabID > | m_aWordID |
the word id. i.e 0,1,2,3,... More... | |
Array< String > | m_aWords |
the string of each vocabulary id More... | |
Array< VocabID > | m_aClass |
store the classes of each word. Support soft and hard class More... | |
Array< Array< VocabID > * > | m_aClass2Word |
store the word belonging to each class. More... | |
Definition at line 34 of file trf-vocab.h.
trf::Vocab::Vocab | ( | ) |
Definition at line 22 of file trf-vocab.cpp.
trf::Vocab::Vocab | ( | const char * | pathVocab | ) |
Definition at line 28 of file trf-vocab.cpp.
trf::Vocab::~Vocab | ( | ) |
Definition at line 110 of file trf-vocab.cpp.
get class
Definition at line 62 of file trf-vocab.h.
get classes of a word sequence
Definition at line 118 of file trf-vocab.cpp.
|
inline |
get class map
Definition at line 60 of file trf-vocab.h.
|
inline |
get the total class number
Definition at line 49 of file trf-vocab.h.
|
inline |
get the vocab size, i.e. the word number
Definition at line 47 of file trf-vocab.h.
get word belonging to a class
Definition at line 76 of file trf-vocab.h.
|
inline |
get word string
Definition at line 51 of file trf-vocab.h.
|
inline |
Check if the VocabID is a legal word.
Definition at line 86 of file trf-vocab.h.
|
inline |
iter all the words, regardless the beg/end symbols
Definition at line 82 of file trf-vocab.h.
|
inline |
iter all the words, regardless the beg/end symbols
Definition at line 84 of file trf-vocab.h.
|
inline |
random a class
Definition at line 70 of file trf-vocab.h.
store the classes of each word. Support soft and hard class
Definition at line 39 of file trf-vocab.h.
store the word belonging to each class.
Definition at line 40 of file trf-vocab.h.
the word id. i.e 0,1,2,3,...
Definition at line 37 of file trf-vocab.h.
the string of each vocabulary id
Definition at line 38 of file trf-vocab.h.