de.danielnaber.languagetool.tagging.disambiguation.rules
Class DisambiguationPatternRule
Object
Rule
AbstractPatternRule
DisambiguationPatternRule
public class DisambiguationPatternRule
- extends AbstractPatternRule
A Rule that describes a pattern of words or part-of-speech tags used for
disambiguation.
- Author:
- Marcin MiĆkowski
| Methods inherited from class Rule |
addRuleMatch, clearMatches, getCategory, getCorrectExamples, getIncorrectExamples, getMatches, getMatchesIndex, isDefaultOff, isInMatches, isInRemoved, isParagraphBackTrack, setAsDeleted, setCategory, setCorrectExamples, setDefaultOff, setIncorrectExamples, setParagraphBackTrack, supportsLanguage |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
setNewInterpretations
public final void setNewInterpretations(AnalyzedToken[] newReadings)
- Used to add new interpretations.
- Parameters:
newReadings - An array of AnalyzedTokens. The length of the array should be the
same as the number of the tokens matched and selected by
mark/mark_from & mark_to attributes (>1).
replace
public final AnalyzedSentence replace(AnalyzedSentence text)
throws IOException
- Performs disambiguation on the source sentence.
- Parameters:
text - #AnalyzedSentence Sentence to be disambiguated.
- Returns:
#AnalyzedSentence Disambiguated sentence (might be
unchanged).
- Throws:
IOException
setExamples
public void setExamples(List<DisambiguatedExample> examples)
- Parameters:
examples - the examples to set
getExamples
public List<DisambiguatedExample> getExamples()
- Returns:
- the examples
setUntouchedExamples
public void setUntouchedExamples(List<String> untouchedExamples)
- Parameters:
untouchedExamples - the untouchedExamples to set
getUntouchedExamples
public List<String> getUntouchedExamples()
- Returns:
- the untouchedExamples
Copyright © 2005-2009 Daniel Naber