|
FreeLing
3.0
|
Class fex_rule stores a feature extraction rule. More...
#include <fex_rule.h>
Public Member Functions | |
| fex_rule (const std::wstring &, const std::wstring &, int, const std::list< fex_condition > &) | |
| Constructor, given pattern, rang, and condition:(focus, function, param) | |
| fex_rule (const fex_rule &) | |
| Copy constructor. | |
| fex_rule & | operator= (const fex_rule &) |
| assignment | |
| void | clear_features () |
| clear existing features set (starting a new sentence) | |
| void | precompute (const sentence &, int) |
| check whether a word matches the rule, precompute the feature, and store it. | |
| void | extract (const sentence &, int, int, std::list< std::wstring > &) const |
| Use precomputed features to extract actual features for word "i" as seen form word "anch". | |
| int | get_left () const |
| get left limit of range | |
| int | get_right () const |
| get right limit of range | |
| void | trace (int) const |
| print rule to stderr in the given tracelevel (debug purposes only) | |
Static Public Member Functions | |
| static bool | check_conds (std::list< fex_condition > &, int, const word &) |
| check a list of conditions with and/or on a word. | |
Static Public Attributes | |
| static std::map< std::wstring, const feature_function * > | feat_functs |
| currently loaded specific feature extraction functions | |
| static std::map< std::wstring, const feature_function * > | nerc_features |
| available NERC-specific feature extraction functions. | |
Private Member Functions | |
| void | pattern_instance (const sentence &, int, std::list< std::wstring > &) const |
| replace marked chunks in a rule pattern (e.g. | |
| void | get_replacements (const std::wstring &, const word &, std::list< std::wstring > &) const |
Private Attributes | |
| std::wstring | pattern |
| rule pattern to build feature | |
| int | left |
| range around target where rule should be applied | |
| int | right |
| std::list< fex_condition > | conds |
| additional condition to be met by the target. | |
| int | operation |
| whether conditions should be joined with AND or OR | |
| std::map< int, std::list < std::wstring > > | features |
| store feature generated by this rule for each word | |
Static Private Attributes | |
| static boost::u32regex | rulepat |
| auxiliar regexs to parse rules | |
| static boost::u32regex | rulepat_anch |
| static boost::u32regex | subexpr |
| static boost::u32regex | featfun |
Class fex_rule stores a feature extraction rule.
| fex_rule::fex_rule | ( | const std::wstring & | , |
| const std::wstring & | , | ||
| int | , | ||
| const std::list< fex_condition > & | |||
| ) |
Constructor, given pattern, rang, and condition:(focus, function, param)
| fex_rule::fex_rule | ( | const fex_rule & | ) |
Copy constructor.
| static bool fex_rule::check_conds | ( | std::list< fex_condition > & | , |
| int | , | ||
| const word & | |||
| ) | [static] |
check a list of conditions with and/or on a word.
| void fex_rule::clear_features | ( | ) |
clear existing features set (starting a new sentence)
| void fex_rule::extract | ( | const sentence & | , |
| int | , | ||
| int | , | ||
| std::list< std::wstring > & | |||
| ) | const |
Use precomputed features to extract actual features for word "i" as seen form word "anch".
| int fex_rule::get_left | ( | ) | const |
get left limit of range
| void fex_rule::get_replacements | ( | const std::wstring & | , |
| const word & | , | ||
| std::list< std::wstring > & | |||
| ) | const [private] |
| int fex_rule::get_right | ( | ) | const |
get right limit of range
| void fex_rule::pattern_instance | ( | const sentence & | , |
| int | , | ||
| std::list< std::wstring > & | |||
| ) | const [private] |
replace marked chunks in a rule pattern (e.g.
: $t(0), $l(-1),...) with appropriate instance for given word
| void fex_rule::precompute | ( | const sentence & | , |
| int | |||
| ) |
check whether a word matches the rule, precompute the feature, and store it.
| void fex_rule::trace | ( | int | ) | const |
print rule to stderr in the given tracelevel (debug purposes only)
std::list<fex_condition> fex_rule::conds [private] |
additional condition to be met by the target.
std::map<std::wstring,const feature_function *> fex_rule::feat_functs [static] |
currently loaded specific feature extraction functions
boost::u32regex fex_rule::featfun [static, private] |
std::map<int,std::list<std::wstring> > fex_rule::features [private] |
store feature generated by this rule for each word
int fex_rule::left [private] |
range around target where rule should be applied
std::map<std::wstring,const feature_function *> fex_rule::nerc_features [static] |
available NERC-specific feature extraction functions.
int fex_rule::operation [private] |
whether conditions should be joined with AND or OR
std::wstring fex_rule::pattern [private] |
rule pattern to build feature
int fex_rule::right [private] |
boost::u32regex fex_rule::rulepat [static, private] |
auxiliar regexs to parse rules
boost::u32regex fex_rule::rulepat_anch [static, private] |
boost::u32regex fex_rule::subexpr [static, private] |
1.7.6.1