FreeLing  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
rule_expression Class Reference

The class rule_expression is an abstract class (interface) for building dynamic restriction on a ruleLabeler which are used by class depLabeler. More...

#include <dep_rules.h>

Inheritance diagram for rule_expression:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 rule_expression ()
 Constructor.
 rule_expression (const std::wstring &, const std::wstring &)
virtual ~rule_expression ()
bool find (const std::wstring &) const
 Search for a value in the list of an expression.
bool find_match (const std::wstring &) const
 Search for a value in the list of an expression, taking into account wildcards.
bool match (const std::wstring &) const
 Match the value against a RegExp.
bool find_any (const std::list< std::wstring > &) const
 Search for any value of a list in the list of an expression.
bool find_any_match (const std::list< std::wstring > &) const
 Search for any value of a list in the list of an expression, taking into account wildcards.
virtual bool check (dep_tree::iterator, dep_tree::iterator) const
 Check wheter a rule_expression can be applied to the given pair of nodes.

Protected Member Functions

bool nodes_to_check (dep_tree::iterator, dep_tree::iterator, std::list< dep_tree::iterator > &) const
 Givent parent and daughter iterators, resolve which of them is to be checked in this condition.
virtual bool eval (dep_tree::iterator) const
 eval whether a single node matches a condition only called from check if needed.

Protected Attributes

std::wstring node
std::set< std::wstring > valueList

Private Member Functions

void parse_node_ref (std::wstring, dep_tree::iterator, std::list< dep_tree::iterator > &) const
 Recursive disassembly of node reference string (e.g.

Detailed Description

The class rule_expression is an abstract class (interface) for building dynamic restriction on a ruleLabeler which are used by class depLabeler.


Constructor & Destructor Documentation

Constructor.

rule_expression::rule_expression ( const std::wstring &  ,
const std::wstring &   
)
virtual rule_expression::~rule_expression ( ) [inline, virtual]

Member Function Documentation

bool rule_expression::check ( dep_tree::iterator  ancestor,
dep_tree::iterator  descendant 
) const [virtual]

Check wheter a rule_expression can be applied to the given pair of nodes.

Reimplemented in check_side, check_not, and check_and.

References TRACE.

Referenced by ruleLabeler::check().

bool rule_expression::eval ( dep_tree::iterator  n) const [protected, virtual]

eval whether a single node matches a condition only called from check if needed.

The abstract class version should never be reached.

Reimplemented in check_asynon, check_synon, check_semfile, check_tonto, check_wordclass, check_category, check_pos, and check_lemma.

bool rule_expression::find ( const std::wstring &  ) const

Search for a value in the list of an expression.

Referenced by depLabeler::build_expression(), check_lemma::eval(), and check_semfile::eval().

bool rule_expression::find_any ( const std::list< std::wstring > &  ) const

Search for any value of a list in the list of an expression.

Referenced by check_tonto::eval(), check_synon::eval(), and check_asynon::eval().

bool rule_expression::find_any_match ( const std::list< std::wstring > &  ) const

Search for any value of a list in the list of an expression, taking into account wildcards.

bool rule_expression::find_match ( const std::wstring &  ) const

Search for a value in the list of an expression, taking into account wildcards.

References TRACE.

Referenced by check_category::eval().

bool rule_expression::match ( const std::wstring &  ) const

Match the value against a RegExp.

References util::set2wstring().

Referenced by check_pos::eval().

Givent parent and daughter iterators, resolve which of them is to be checked in this condition.

void rule_expression::parse_node_ref ( std::wstring  ,
dep_tree::iterator  ,
std::list< dep_tree::iterator > &   
) const [private]

Recursive disassembly of node reference string (e.g.

p:sn:sajd) to get the right iterator. When (if) found, add it to given list.

References TRACE.


Member Data Documentation

std::wstring rule_expression::node [protected]
std::set<std::wstring> rule_expression::valueList [protected]

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