public class DisambiguationPatternRule extends AbstractTokenBasedRule
| Modifier and Type | Class and Description |
|---|---|
static class |
DisambiguationPatternRule.DisambiguatorAction
Possible disambiguator actions.
|
antiPatterns, endPositionCorrection, filter, filterArgs, language, message, patternTokens, sentStart, sourceFile, startPositionCorrection, subId, suggestionMatches, suggestionMatchesOutMsg, suggestionsOutMsg, testUnification, type| Constructor and Description |
|---|
DisambiguationPatternRule(String id,
String description,
Language language,
List<PatternToken> patternTokens,
String disambiguatedPOS,
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) |
canBeIgnoredForaddSuggestionMatch, addSuggestionMatchOutMsg, getAntiPatterns, getDescription, getEndPositionCorrection, getFilter, getFilterArguments, getFullId, getId, getLanguage, getMessage, getPatternRuleId, getPatternTokens, getSourceFile, getStartPositionCorrection, getSubId, getSuggestionMatches, getSuggestionsOutMsg, getType, getXmlLineNumber, isAdjustSuggestionCase, isGetUnified, isGroupsOrUnification, isSentStart, isTestUnification, match, setAdjustSuggestionCase, setAntiPatterns, setEndPositionCorrection, setFilter, setFilterArguments, setMessage, setStartPositionCorrection, setSubId, setType, setXmlLineNumber, supportsLanguage, toStringaddExamplePair, addTags, addToneTags, cacheAntiPatterns, estimateContextForSureMatch, getCategory, getCorrectExamples, getDistanceTokens, getErrorTriggeringExamples, getIncorrectExamples, getLocQualityIssueType, getMinPrevMatches, getPriority, getRuleOptions, getSentenceWithImmunization, getTags, getToneTags, getUrl, hasTag, hasToneTag, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isGoalSpecific, isIncludedInHiddenMatches, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setGoalSpecific, setIncludedInHiddenMatches, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setPriority, setTags, setToneTags, setUrl, toRuleMatchArray, useInOfficepublic DisambiguationPatternRule(String id, String description, Language language, List<PatternToken> patternTokens, String disambiguatedPOS, 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)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)
public List<DisambiguatedExample> getExamples()
public DisambiguationPatternRule.DisambiguatorAction getAction()
public AnalyzedToken[] getNewTokenReadings()
@Nullable public Match getMatchElement()
@Nullable public String getDisambiguatedPOS()