de.danielnaber.languagetool.tagging.disambiguation.rules
Class DisambiguationPatternRule

Object
  extended by Rule
      extended by AbstractPatternRule
          extended by 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

Nested Class Summary
static class DisambiguationPatternRule.DisambiguatorAction
          Possible disambiguator actions.
 
Method Summary
 List<DisambiguatedExample> getExamples()
           
 List<String> getUntouchedExamples()
           
 AnalyzedSentence replace(AnalyzedSentence text)
          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)
           
 
Methods inherited from class AbstractPatternRule
getDescription, getId, match, reset, setEndPositionCorrection, setStartPositionCorrection, toString
 
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
 

Method Detail

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