An interface for tag transformations on a tagged corpus, as performed
by brill taggers. Each transformation finds all tokens in the corpus that
are tagged with a specific original tag and satisfy a specific condition, and
replaces their tags with a replacement tag. For any given transformation, the
original tag, replacement tag, and condition are fixed. Conditions may
depend on the token under consideration, as well as any other tokens in
the corpus.
Brill rules must be comparable and hashable.
Method Summary |
|
__eq__(self)
|
|
__hash__(self)
|
Boolean
|
applies (self,
tokens,
index)
Return true if the rule would change the tag of tokens[index] ,
False otherwise |
int
|
apply_at (self,
tokens,
positions)
Apply this rule at every position in positions where it
applies to the corpus. |
list of int
|
apply_to (self,
tokens)
Apply this rule everywhere it applies in the corpus. |
any
|
original_tag (self)
Return the tag which this BrillRuleI may cause to be
replaced. |
any
|
replacement_tag (self)
Return the tag with which this BrillRuleI may replace another
tag. |
Inherited from object :
__init__ ,
__delattr__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|