public class DisambiguationPatternRule extends AbstractPatternRule
| Modifier and Type | Class and Description |
|---|---|
static class |
DisambiguationPatternRule.DisambiguatorAction
Possible disambiguator actions.
|
endPositionCorrection, language, patternTokens, sentStart, startPositionCorrection, subId, testUnification| Constructor and Description |
|---|
DisambiguationPatternRule(String id,
String description,
Language language,
List<PatternToken> patternTokens,
String disamb,
Match posSelect,
DisambiguationPatternRule.DisambiguatorAction disambAction) |
| Modifier and Type | Method and Description |
|---|---|
DisambiguationPatternRule.DisambiguatorAction |
getAction() |
String |
getDisambiguatedPOS() |
List<DisambiguatedExample> |
getExamples() |
Match |
getMatchElement() |
AnalyzedToken[] |
getNewTokenReadings() |
List<String> |
getUntouchedExamples() |
AnalyzedSentence |
replace(AnalyzedSentence sentence)
Performs disambiguation on the source sentence.
|
void |
setExamples(List<DisambiguatedExample> examples) |
void |
setNewInterpretations(AnalyzedToken[] newReadings)
Used to add new interpretations.
|
void |
setUntouchedExamples(List<String> untouchedExamples) |
getDescription, getEndPositionCorrection, getId, getLanguage, getPatternTokens, getStartPositionCorrection, getSubId, isGetUnified, isGroupsOrUnification, isSentStart, isTestUnification, match, reset, setEndPositionCorrection, setStartPositionCorrection, setSubId, supportsLanguage, toStringaddExamplePair, getCategory, getCorrectExamples, getIncorrectExamples, getLocQualityIssueType, getUrl, isDefaultOff, isDictionaryBasedSpellingRule, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setIncorrectExamples, setLocQualityIssueType, setUrl, toRuleMatchArray, useInOfficepublic DisambiguationPatternRule(String id, String description, Language language, List<PatternToken> patternTokens, String disamb, Match posSelect, DisambiguationPatternRule.DisambiguatorAction disambAction)
id - Id of the Rulelanguage - Language of the Ruledescription - Description to be shown (name)disambAction - the action to be executed on found token(s), one of the
following: add, filter, filterall, ignore_spelling, immunize, remove, replace, unify.public final void setNewInterpretations(AnalyzedToken[] newReadings)
newReadings - An array of AnalyzedTokens. The length of the array should be the
same as the number of the tokens matched and selected by
<marker>...</marker> elements.public final AnalyzedSentence replace(AnalyzedSentence sentence) throws IOException
sentence - AnalyzedSentence Sentence to be disambiguated.AnalyzedSentence Disambiguated sentence (might be unchanged).IOExceptionpublic void setExamples(List<DisambiguatedExample> examples)
examples - the examples to setpublic List<DisambiguatedExample> getExamples()
public void setUntouchedExamples(List<String> untouchedExamples)
untouchedExamples - the untouchedExamples to setpublic DisambiguationPatternRule.DisambiguatorAction getAction()
public AnalyzedToken[] getNewTokenReadings()
public Match getMatchElement()
public String getDisambiguatedPOS()