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) |
canBeIgnoredFor
addSuggestionMatch, addSuggestionMatchOutMsg, getAntiPatterns, getDescription, getEndPositionCorrection, getFilter, getFilterArguments, getFullId, getId, getLanguage, getMessage, getPatternRuleId, getPatternTokens, getSourceFile, getStartPositionCorrection, getSubId, getSuggestionsOutMsg, getType, getXmlLineNumber, isAdjustSuggestionCase, isGetUnified, isGroupsOrUnification, isSentStart, isTestUnification, match, setAdjustSuggestionCase, setAntiPatterns, setEndPositionCorrection, setFilter, setFilterArguments, setMessage, setStartPositionCorrection, setSubId, setType, setXmlLineNumber, supportsLanguage, toString
addExamplePair, addTags, cacheAntiPatterns, estimateContextForSureMatch, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getDistanceTokens, getErrorTriggeringExamples, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getMinPrevMatches, getSentenceWithImmunization, getTags, getUrl, hasConfigurableValue, hasTag, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setTags, setUrl, toRuleMatchArray, useInOffice
public 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).IOException
public void setExamples(List<DisambiguatedExample> examples)
public List<DisambiguatedExample> getExamples()
public DisambiguationPatternRule.DisambiguatorAction getAction()
public AnalyzedToken[] getNewTokenReadings()
@Nullable public Match getMatchElement()
@Nullable public String getDisambiguatedPOS()