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>
Public Member Functions | |
rule_expression () | |
Constructor. | |
rule_expression (const std::string &, const std::string &) | |
virtual | ~rule_expression () |
bool | find (const std::string &) const |
bool | find_match (const std::string &) const |
bool | match (const std::string &) const |
bool | find_any (const std::list< std::string > &) const |
bool | find_any_match (const std::list< std::string > &) const |
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 |
virtual bool | eval (dep_tree::iterator) const |
eval whether a single node matches a condition only called from check if needed. | |
Protected Attributes | |
std::string | node |
std::set< std::string > | valueList |
Private Member Functions | |
dep_tree::iterator | parse_node_ref (std::string, dep_tree::iterator) const |
The class rule_expression is an abstract class (interface) for building dynamic restriction on a ruleLabeler which are used by class depLabeler.
rule_expression::rule_expression | ( | ) |
Constructor.
rule_expression::rule_expression | ( | const std::string & | , | |
const std::string & | ||||
) |
virtual rule_expression::~rule_expression | ( | ) | [inline, virtual] |
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_and, check_not, and check_side.
References eval(), nodes_to_check(), and TRACE.
Referenced by ruleLabeler::check(), and check_not::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_lemma, check_pos, check_category, check_wordclass, check_tonto, check_semfile, check_synon, and check_asynon.
Referenced by check().
bool rule_expression::find | ( | const std::string & | ) | const |
Referenced by check_semfile::eval(), and check_lemma::eval().
bool rule_expression::find_any | ( | const std::list< std::string > & | ) | const |
Referenced by check_asynon::eval(), check_synon::eval(), and check_tonto::eval().
bool rule_expression::find_any_match | ( | const std::list< std::string > & | ) | const |
bool rule_expression::find_match | ( | const std::string & | ) | const |
Referenced by check_category::eval().
bool rule_expression::match | ( | const std::string & | ) | const |
Referenced by check_pos::eval().
bool rule_expression::nodes_to_check | ( | dep_tree::iterator | , | |
dep_tree::iterator | , | |||
std::list< dep_tree::iterator > & | ||||
) | const [protected] |
Referenced by check().
dep_tree::iterator rule_expression::parse_node_ref | ( | std::string | , | |
dep_tree::iterator | ||||
) | const [private] |
std::string rule_expression::node [protected] |
std::set<std::string> rule_expression::valueList [protected] |
Referenced by check_side::check(), and check_wordclass::eval().