|
TRF Language Model
|
define the feature style. such as "w3"(word-3gram); "c2"(class-2gram); More...
#include <trf-feature.h>
Public Member Functions | |
| FeatTable (const char *pstyle="") | |
| constructor More... | |
| ~FeatTable () | |
| destructor More... | |
| void | Reset (const char *pstyle) |
| Reset. More... | |
| int | GetNum () const |
| get number More... | |
| int | GetMinOrder () const |
| get minimum order More... | |
| int | GetMaxOrder () const |
| get maxmum order More... | |
| const char * | GetStyle () const |
| get style string More... | |
| void | LoadFeat (Seq &seq) |
| Extract a feature from a sequence. More... | |
| void | IndexFeat (int begIdx) |
| Set the number of each features. We should index the feature in defferent tables. More... | |
| int | CutoffFeat () |
| cutoff the features More... | |
| void | Find (Array< int > &afeat, Array< int > &key, bool bBeg, bool bEnd) |
| Find the corresponding feature using a key. This will return the beg/end ngram. More... | |
| void | Find (Array< int > &afeat, Seq &seq, int pos, int order) |
| Find the ngram feature with a fixed order. More... | |
| void | Find (Array< int > &afeat, Seq &seq) |
| Find all the feature in the sequence. More... | |
| void | FindPosDep (Array< int > &afeat, Seq &seq, int pos) |
| Find all the feature depending on position. More... | |
| void | ReadT (File &file, PValue *pValue=NULL) |
| Read form file. More... | |
| void | WriteT (File &file, PValue *pValue=NULL) |
| Write to file. More... | |
Public Attributes | |
| String | m_style |
| using a string array to store the feature styles in this table, such as w2, w3,... More... | |
| int | m_nMinOrder |
| the ngram minimum order, including the skip distance More... | |
| int | m_nMaxOrder |
| the ngram maximum order, including the skip distance More... | |
| int | m_nNum |
| the ngram number More... | |
| Array< int > | m_aCutoff |
| cutoff setting for different order More... | |
| Trie< VocabID, int > * | m_ptrie |
| index all the features. More... | |
| Array< FeatStyle * > | m_aStyleInfo |
| Array< Array< int > * > | m_aKey |
| define the key for each thread More... | |
define the feature style. such as "w3"(word-3gram); "c2"(class-2gram);
Definition at line 124 of file trf-feature.h.
| trf::FeatTable::FeatTable | ( | const char * | pstyle = "" | ) |
constructor
Definition at line 112 of file trf-feature.cpp.
| trf::FeatTable::~FeatTable | ( | ) |
destructor
Definition at line 122 of file trf-feature.cpp.
| int trf::FeatTable::CutoffFeat | ( | ) |
cutoff the features
Definition at line 209 of file trf-feature.cpp.
Find the corresponding feature using a key. This will return the beg/end ngram.
Definition at line 268 of file trf-feature.cpp.
Find the ngram feature with a fixed order.
Definition at line 293 of file trf-feature.cpp.
Find all the feature in the sequence.
Definition at line 306 of file trf-feature.cpp.
Find all the feature depending on position.
Definition at line 320 of file trf-feature.cpp.
|
inline |
get maxmum order
Definition at line 150 of file trf-feature.h.
|
inline |
get minimum order
Definition at line 148 of file trf-feature.h.
|
inline |
get number
Definition at line 146 of file trf-feature.h.
|
inline |
get style string
Definition at line 152 of file trf-feature.h.
| void trf::FeatTable::IndexFeat | ( | int | begIdx | ) |
Set the number of each features. We should index the feature in defferent tables.
Definition at line 252 of file trf-feature.cpp.
| void trf::FeatTable::LoadFeat | ( | Seq & | seq | ) |
Extract a feature from a sequence.
Definition at line 172 of file trf-feature.cpp.
Read form file.
Definition at line 333 of file trf-feature.cpp.
| void trf::FeatTable::Reset | ( | const char * | pstyle | ) |
Reset.
Definition at line 128 of file trf-feature.cpp.
Write to file.
Definition at line 360 of file trf-feature.cpp.
| Array<int> trf::FeatTable::m_aCutoff |
cutoff setting for different order
Definition at line 131 of file trf-feature.h.
define the key for each thread
Definition at line 136 of file trf-feature.h.
Definition at line 134 of file trf-feature.h.
| int trf::FeatTable::m_nMaxOrder |
the ngram maximum order, including the skip distance
Definition at line 129 of file trf-feature.h.
| int trf::FeatTable::m_nMinOrder |
the ngram minimum order, including the skip distance
Definition at line 128 of file trf-feature.h.
| int trf::FeatTable::m_nNum |
the ngram number
Definition at line 130 of file trf-feature.h.
index all the features.
Definition at line 132 of file trf-feature.h.
| String trf::FeatTable::m_style |
using a string array to store the feature styles in this table, such as w2, w3,...
Definition at line 127 of file trf-feature.h.