index
module components.evita.rule
FeatureRule
Code to apply Evita feature rules

Contains the code for matching token sequences against feature rules. The
feature rules are defined in library.evita.patterns.feature_rules.FEATURE_RULES
and are used by the VChunkFeatures class in Evita.
class FeatureRule
Inherits from: object

Objects of this class contain a chunk and a feature rule and are tasked
with matching the rule to the chunk.

Public Functions

__init__(self, rule, chunk)
Initialize the rule, with name, left-hand side and right-hand side, and add the chunk it will apply to.
__str__(self)
match(self)
Match the rule to the chunk. Return the right-hand side of the rule if it was succesfull and return False otherwise.

Private Functions

_checkItem(self, chunk_element, ruleInfo)
Check whether the chunk element matches the rule.
_matchPos(self, ruleInfo, i)
Match the rule info to the pos of the token at index i. If there is no ruleInfo, then consider the rule matched.
_matchWord(self, ruleInfo, i)
Match the rule info to the string of the token at index i. If there is no ruleInfo, then consider the rule matched.