Class DisambiguationPatternRuleReplacer
java.lang.Object
org.languagetool.rules.patterns.AbstractPatternRulePerformer
org.languagetool.tagging.disambiguation.rules.DisambiguationPatternRuleReplacer
- Since:
- 2.3
-
Field Summary
FieldsFields inherited from class org.languagetool.rules.patterns.AbstractPatternRulePerformer
prevMatched, rule, unifiedTokens, unifier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate 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) final 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
-
Field Details
-
pTokensMatched
-
-
Constructor Details
-
DisambiguationPatternRuleReplacer
DisambiguationPatternRuleReplacer(DisambiguationPatternRule rule)
-
-
Method Details
-
replace
- Throws:
IOException
-
keepByDisambig
private boolean keepByDisambig(AnalyzedSentence sentence, int ruleMatchFromPos, int ruleMatchToPos) throws IOException - Throws:
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 IOException - Overrides:
skipMaxTokens
in classAbstractPatternRulePerformer
- Throws:
IOException
-
executeAction
private AnalyzedTokenReadings[] executeAction(AnalyzedSentence sentence, AnalyzedTokenReadings[] whiteTokens, AnalyzedTokenReadings[] unifiedTokens, int firstMatchToken, int lastMatchToken, int matchingTokens, int[] tokenPositions)
-