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 PatternToken
private PatternToken
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addMemberAndGroup
(AnalyzedToken token) Enables testing multiple conditions specified by different elements.final boolean
checkAndGroup
(boolean previousValue) boolean
final boolean
final boolean
isMatched
(AnalyzedToken token) Checks whether the rule element matches the token given as a parameter.boolean
final boolean
(package private) void
prepareAndGroup
(int firstMatchToken, AnalyzedTokenReadings[] tokens, Language language) void
resolveReference
(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
-