FreeLing  4.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
freeling::fex_rule Class Reference

Class fex_rule stores a feature extraction rule. More...

#include <fex_rule.h>

Collaboration diagram for freeling::fex_rule:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 fex_rule (const std::wstring &, const std::wstring &, const std::wstring &, int, const std::list< fex_condition > &, const std::map< std::wstring, const feature_function * > &)
 Constructor, given id, pattern, rang, and condition:(focus, function, param)
 fex_rule (const fex_rule &)
 Copy constructor.
fex_ruleoperator= (const fex_rule &)
 assignment
std::wstring get_id () const
void precompute (const sentence &, int, const tagset &) const
 check whether a word matches the rule, precompute the feature, and store it.
void extract (const sentence &, int, int, const tagset &, 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 (const std::list< fex_condition > &, int, const word &, const tagset &, fex_status *)
 check a list of conditions with and/or on a word.

Private Member Functions

void pattern_instance (const sentence &, int, const tagset &, std::list< std::wstring > &) const
 replace marked chunks in a rule pattern (e.g.
void get_replacements (const std::wstring &, const word &, const tagset &, std::list< std::wstring > &) const

Private Attributes

std::wstring rid
 rule id
std::wstring pattern
 rule pattern to build feature
int left
 range around target where rule should be applied
int right
std::list< fex_conditionconds
 additional condition to be met by the target.
int operation
 whether conditions should be joined with AND or OR
const std::map< std::wstring,
const feature_function * > & 
feat_functs

Static Private Attributes

static const freeling::regexp rulepat
 auxiliar regexs to parse rules
static const freeling::regexp rulepat_anch
static const freeling::regexp subexpr
static const freeling::regexp featfun

Detailed Description

Class fex_rule stores a feature extraction rule.


Constructor & Destructor Documentation

freeling::fex_rule::fex_rule ( const std::wstring &  ,
const std::wstring &  ,
const std::wstring &  ,
int  ,
const std::list< fex_condition > &  ,
const std::map< std::wstring, const feature_function * > &   
)

Constructor, given id, pattern, rang, and condition:(focus, function, param)

Copy constructor.


Member Function Documentation

static bool freeling::fex_rule::check_conds ( const std::list< fex_condition > &  ,
int  ,
const word ,
const tagset ,
fex_status  
) [static]

check a list of conditions with and/or on a word.

void freeling::fex_rule::extract ( const sentence ,
int  ,
int  ,
const tagset ,
std::list< std::wstring > &   
) const

Use precomputed features to extract actual features for word "i" as seen form word "anch".

std::wstring freeling::fex_rule::get_id ( ) const

get left limit of range

void freeling::fex_rule::get_replacements ( const std::wstring &  ,
const word ,
const tagset ,
std::list< std::wstring > &   
) const [private]

get right limit of range

fex_rule& freeling::fex_rule::operator= ( const fex_rule )

assignment

void freeling::fex_rule::pattern_instance ( const sentence ,
int  ,
const tagset ,
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 freeling::fex_rule::precompute ( const sentence ,
int  ,
const tagset  
) const

check whether a word matches the rule, precompute the feature, and store it.

void freeling::fex_rule::trace ( int  ) const

print rule to stderr in the given tracelevel (debug purposes only)


Member Data Documentation

additional condition to be met by the target.

const std::map<std::wstring,const feature_function*>& freeling::fex_rule::feat_functs [private]

range around target where rule should be applied

whether conditions should be joined with AND or OR

std::wstring freeling::fex_rule::pattern [private]

rule pattern to build feature

std::wstring freeling::fex_rule::rid [private]

rule id

auxiliar regexs to parse rules


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