Package org.languagetool.rules.patterns
Class PatternTokenMatcher
java.lang.Object
org.languagetool.rules.patterns.PatternTokenMatcher
- Since:
- 2.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<PatternTokenMatcher> private boolean[]private final PatternTokenprivate PatternToken -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddMemberAndGroup(AnalyzedToken token) Enables testing multiple conditions specified by different elements.final booleancheckAndGroup(boolean previousValue) booleanfinal booleanfinal booleanisMatched(AnalyzedToken token) Checks whether the rule element matches the token given as a parameter.booleanfinal boolean(package private) voidprepareAndGroup(int firstMatchToken, AnalyzedTokenReadings[] tokens, Language language) voidresolveReference(int firstMatchToken, AnalyzedTokenReadings[] tokens, Language language) toString()
-
Field Details
-
basePatternToken
-
patternToken
-
andGroup
-
andGroupCheck
private boolean[] andGroupCheck
-
-
Constructor Details
-
PatternTokenMatcher
-
-
Method Details
-
resolveReference
public void resolveReference(int firstMatchToken, AnalyzedTokenReadings[] tokens, Language language) throws IOException - Throws:
IOException
-
getPatternToken
-
isMatched
Checks whether the rule element matches the token given as a parameter.- Parameters:
token- AnalyzedToken to check matching against- Returns:
- True if token matches, false otherwise.
-
prepareAndGroup
void prepareAndGroup(int firstMatchToken, AnalyzedTokenReadings[] tokens, Language language) throws IOException - Throws:
IOException
-
addMemberAndGroup
Enables testing multiple conditions specified by different elements. Doesn't test exceptions. Works as logical AND operator only if preceded withprepareAndGroup(int, AnalyzedTokenReadings[], Language), and followed bycheckAndGroup(boolean)- Parameters:
token- the token checked.
-
checkAndGroup
public final boolean checkAndGroup(boolean previousValue) -
isMatchedByScopeNextException
-
isExceptionMatchedCompletely
-
hasPreviousException
public boolean hasPreviousException() -
isMatchedByPreviousException
-
toString
-