public interface TaggerRule
This defines an interface for rule-based part of speech tag replacment in a tagged corpus. Each rule locates all the words in a corpus tagged with a specific original part of speech tag and satisfying a specific condition. When the condition is satisfied, the rule replaces the original tag with a replacement tag.
The original tag, the replacement tag, and the condition for replacement are fixed during rule instantiation. The replacement conditions may involve the spelling and/or tag of a word as well as the word's position with respect to other words and their tags in the corpus.
Modifier and Type | Method and Description |
---|---|
int |
applies(int site,
java.util.List<TrainingWord> trainingData)
See if this rule applies to a training site.
|
int |
apply(int[] sites,
java.util.List<TrainingWord> trainingData)
Apply this rule to a a list of training sites.
|
boolean |
apply(int site,
java.util.List<TrainingWord> trainingData)
Apply this rule to a specific training site.
|
int |
apply(java.util.List<TrainingWord> trainingData)
Apply this rule to all training data.
|
java.lang.String |
getOriginalTag()
Return original tag.
|
java.lang.String |
getReplacementTag()
Return replacement tag.
|
int apply(java.util.List<TrainingWord> trainingData)
trainingData
- Training data as a list.boolean apply(int site, java.util.List<TrainingWord> trainingData)
site
- Index (0-based) of training site
at which to apply rule.trainingData
- Training data as a list.int apply(int[] sites, java.util.List<TrainingWord> trainingData)
sites
- Indices (0-based) of training sites
at which to apply rule.trainingData
- Training data as a list.int applies(int site, java.util.List<TrainingWord> trainingData)
site
- Index (0-based) of training site
at which to check that rule applies.trainingData
- Training data.java.lang.String getOriginalTag()
java.lang.String getReplacementTag()