TRF Language Model
trf::Feat Class Reference

include all the feature table More...

#include <trf-feature.h>

Public Member Functions

 Feat (int nOrder=0, bool bClass=true)
 
 ~Feat ()
 
void Reset (int nOrder, bool bClass)
 Reset, set the order. Node: the maximum order (including the skip) may be larger than nOrder. More...
 
void Reset (const char *pfeatType)
 Reset, read a feature type files. More...
 
int GetMaxOrder ()
 Get maximum order. More...
 
int GetNum () const
 Get number. 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 FindClass (Array< int > &afeat, Seq &seq, int pos, int order)
 Find the class ngram feature with a fixed order. More...
 
void FindWord (Array< int > &afeat, Seq &seq, int pos, int order)
 Find the ngram feature depending on word[pos]. More...
 
void FindPosDep (Array< int > &afeat, Seq &seq, int pos, int type=0)
 Find the class ngram depending on the nPos. More...
 
void LoadFeatFromCorpus (const char *path, Vocab *pv)
 Load Features from corpus. More...
 
void WriteT (File &file, PValue *pValue=NULL)
 Write the features. More...
 
void ReadT (File &file, PValue *pValue=NULL)
 Read the features. More...
 

Public Attributes

Array< FeatTable * > m_aTable
 different feature table More...
 
int m_nTotalNum
 total feature number More...
 

Detailed Description

include all the feature table

Definition at line 179 of file trf-feature.h.

Constructor & Destructor Documentation

§ Feat()

trf::Feat::Feat ( int  nOrder = 0,
bool  bClass = true 
)
inline

Definition at line 185 of file trf-feature.h.

§ ~Feat()

trf::Feat::~Feat ( )
inline

Definition at line 192 of file trf-feature.h.

Member Function Documentation

§ Find() [1/2]

void trf::Feat::Find ( Array< int > &  afeat,
Seq seq,
int  pos,
int  order 
)

Find the ngram feature with a fixed order.

Definition at line 443 of file trf-feature.cpp.

§ Find() [2/2]

void trf::Feat::Find ( Array< int > &  afeat,
Seq seq 
)

Find all the feature in the sequence.

Definition at line 449 of file trf-feature.cpp.

§ FindClass()

void trf::Feat::FindClass ( Array< int > &  afeat,
Seq seq,
int  pos,
int  order 
)

Find the class ngram feature with a fixed order.

Definition at line 455 of file trf-feature.cpp.

§ FindPosDep()

void trf::Feat::FindPosDep ( Array< int > &  afeat,
Seq seq,
int  pos,
int  type = 0 
)

Find the class ngram depending on the nPos.

Definition at line 473 of file trf-feature.cpp.

§ FindWord()

void trf::Feat::FindWord ( Array< int > &  afeat,
Seq seq,
int  pos,
int  order 
)

Find the ngram feature depending on word[pos].

Definition at line 464 of file trf-feature.cpp.

§ GetMaxOrder()

int trf::Feat::GetMaxOrder ( )

Get maximum order.

Definition at line 435 of file trf-feature.cpp.

§ GetNum()

int trf::Feat::GetNum ( ) const
inline

Get number.

Definition at line 200 of file trf-feature.h.

§ LoadFeatFromCorpus()

void trf::Feat::LoadFeatFromCorpus ( const char *  path,
Vocab pv 
)

Load Features from corpus.

Definition at line 505 of file trf-feature.cpp.

§ ReadT()

void trf::Feat::ReadT ( File file,
PValue pValue = NULL 
)

Read the features.

Definition at line 571 of file trf-feature.cpp.

§ Reset() [1/2]

void trf::Feat::Reset ( int  nOrder,
bool  bClass 
)

Reset, set the order. Node: the maximum order (including the skip) may be larger than nOrder.

add the styles

Definition at line 384 of file trf-feature.cpp.

§ Reset() [2/2]

void trf::Feat::Reset ( const char *  pfeatType)

Reset, read a feature type files.

Definition at line 405 of file trf-feature.cpp.

§ WriteT()

void trf::Feat::WriteT ( File file,
PValue pValue = NULL 
)

Write the features.

Definition at line 558 of file trf-feature.cpp.

Member Data Documentation

§ m_aTable

Array<FeatTable*> trf::Feat::m_aTable

different feature table

Definition at line 182 of file trf-feature.h.

§ m_nTotalNum

int trf::Feat::m_nTotalNum

total feature number

Definition at line 183 of file trf-feature.h.


The documentation for this class was generated from the following files: