Class DisambiguationPatternRuleReplacer
- java.lang.Object
-
- org.languagetool.rules.patterns.AbstractPatternRulePerformer
-
- org.languagetool.tagging.disambiguation.rules.DisambiguationPatternRuleReplacer
-
class DisambiguationPatternRuleReplacer extends AbstractPatternRulePerformer
- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Boolean>
pTokensMatched
-
Fields inherited from class org.languagetool.rules.patterns.AbstractPatternRulePerformer
prevMatched, rule, unifiedTokens, unifier
-
-
Constructor Summary
Constructors Constructor Description DisambiguationPatternRuleReplacer(DisambiguationPatternRule rule)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private AnalyzedTokenReadings[]
executeAction(AnalyzedSentence sentence, AnalyzedTokenReadings[] whiteTokens, AnalyzedTokenReadings[] unifiedTokens, int firstMatchToken, int lastMatchToken, int matchingTokens, int[] tokenPositions)
private boolean
keepByDisambig(AnalyzedSentence sentence, int ruleMatchFromPos, int ruleMatchToPos)
private boolean
keepDespiteFilter(AnalyzedTokenReadings[] tokens, int[] tokenPositions, int firstMatchToken, int lastMatchToken)
AnalyzedSentence
replace(AnalyzedSentence sentence)
protected int
skipMaxTokens(AnalyzedTokenReadings[] tokens, PatternTokenMatcher matcher, int firstMatchToken, int prevSkipNext, PatternTokenMatcher prevElement, int m, int remainingElems)
-
Methods inherited from class org.languagetool.rules.patterns.AbstractPatternRulePerformer
createElementMatchers, getMinOccurrenceCorrection, testAllReadings, testUnificationAndGroups
-
-
-
-
Constructor Detail
-
DisambiguationPatternRuleReplacer
DisambiguationPatternRuleReplacer(DisambiguationPatternRule rule)
-
-
Method Detail
-
replace
public final AnalyzedSentence replace(AnalyzedSentence sentence) throws java.io.IOException
- Throws:
java.io.IOException
-
keepByDisambig
private boolean keepByDisambig(AnalyzedSentence sentence, int ruleMatchFromPos, int ruleMatchToPos) throws java.io.IOException
- Throws:
java.io.IOException
-
keepDespiteFilter
private boolean keepDespiteFilter(AnalyzedTokenReadings[] tokens, int[] tokenPositions, int firstMatchToken, int lastMatchToken)
-
skipMaxTokens
protected int skipMaxTokens(AnalyzedTokenReadings[] tokens, PatternTokenMatcher matcher, int firstMatchToken, int prevSkipNext, PatternTokenMatcher prevElement, int m, int remainingElems) throws java.io.IOException
- Overrides:
skipMaxTokens
in classAbstractPatternRulePerformer
- Throws:
java.io.IOException
-
executeAction
private AnalyzedTokenReadings[] executeAction(AnalyzedSentence sentence, AnalyzedTokenReadings[] whiteTokens, AnalyzedTokenReadings[] unifiedTokens, int firstMatchToken, int lastMatchToken, int matchingTokens, int[] tokenPositions)
-
-