|
FreeLing
3.0
|
Class fex implements a feature extractor. More...
#include <fex.h>

Public Member Functions | |
| fex (const std::wstring &, const std::wstring &, const std::map< std::wstring, const feature_function * > &) | |
| constructor, given rule file, lexicon file (may be empty), and custom functions | |
| void | encode_name (const sentence &, std::vector< std::set< std::wstring > > &) |
| encode given sentence in features as feature names. | |
| void | encode_int (const sentence &, std::vector< std::set< int > > &) |
| encode given sentence in features as integer feature codes | |
| void | encode_all (const sentence &, std::vector< std::set< std::wstring > > &, std::vector< std::set< int > > &) |
| encode given sentence in features as integer feature codes and as features names | |
| std::vector< std::set < std::wstring > > | encode_name (const sentence &) |
| encode given sentence in features as feature names. Return result apt for Java/perl APIs | |
| std::vector< std::set< int > > | encode_int (const sentence &) |
| encode given sentence in features as integer feature codes. Return result apt for Java/perl APIs | |
| void | clear_lexicon () |
| clear lexicon | |
| void | encode_to_lexicon (const sentence &) |
| encode sentence and add features to current lexicon | |
| void | save_lexicon (const std::wstring &, double) const |
| save lexicon to a file, filtering features with low occurrence rate | |
Private Member Functions | |
| void | get_features (const sentence &, std::vector< std::set< std::wstring > > &, std::vector< std::set< int > > &, int) |
| extract features from a sentence | |
| void | read_condition (std::wistringstream &, const std::wstring &, std::list< fex_condition > &, int &) |
| read rule conditions | |
| void | precompute_once (fex_rulepack &, const sentence &) |
| Apply all rules in the pack once to each word in the sentence. | |
| void | precompute_range (fex_rulepack &, const sentence &) |
| Apply all rules in the pack only to proper range around words matching pack condition. | |
Private Attributes | |
| std::list< fex_rulepack > | packs |
| rules used by the feature extractor | |
| fex_lexicon | lex |
| lexicon used to filter features. | |
Class fex implements a feature extractor.
| fex::fex | ( | const std::wstring & | , |
| const std::wstring & | , | ||
| const std::map< std::wstring, const feature_function * > & | |||
| ) |
constructor, given rule file, lexicon file (may be empty), and custom functions
| void fex::clear_lexicon | ( | ) |
clear lexicon
| void fex::encode_all | ( | const sentence & | , |
| std::vector< std::set< std::wstring > > & | , | ||
| std::vector< std::set< int > > & | |||
| ) |
encode given sentence in features as integer feature codes and as features names
| void fex::encode_int | ( | const sentence & | , |
| std::vector< std::set< int > > & | |||
| ) |
encode given sentence in features as integer feature codes
Referenced by bioner::analyze().
| std::vector<std::set<int> > fex::encode_int | ( | const sentence & | ) |
encode given sentence in features as integer feature codes. Return result apt for Java/perl APIs
| void fex::encode_name | ( | const sentence & | , |
| std::vector< std::set< std::wstring > > & | |||
| ) |
encode given sentence in features as feature names.
| std::vector<std::set<std::wstring> > fex::encode_name | ( | const sentence & | ) |
encode given sentence in features as feature names. Return result apt for Java/perl APIs
| void fex::encode_to_lexicon | ( | const sentence & | ) |
encode sentence and add features to current lexicon
| void fex::get_features | ( | const sentence & | , |
| std::vector< std::set< std::wstring > > & | , | ||
| std::vector< std::set< int > > & | , | ||
| int | |||
| ) | [private] |
extract features from a sentence
| void fex::precompute_once | ( | fex_rulepack & | , |
| const sentence & | |||
| ) | [private] |
Apply all rules in the pack once to each word in the sentence.
| void fex::precompute_range | ( | fex_rulepack & | , |
| const sentence & | |||
| ) | [private] |
Apply all rules in the pack only to proper range around words matching pack condition.
| void fex::read_condition | ( | std::wistringstream & | , |
| const std::wstring & | , | ||
| std::list< fex_condition > & | , | ||
| int & | |||
| ) | [private] |
read rule conditions
| void fex::save_lexicon | ( | const std::wstring & | , |
| double | |||
| ) | const |
save lexicon to a file, filtering features with low occurrence rate
fex_lexicon fex::lex [private] |
lexicon used to filter features.
std::list<fex_rulepack> fex::packs [private] |
rules used by the feature extractor
1.7.6.1