Package org.languagetool.rules.patterns
Class RegexAntiPatternFilter
java.lang.Object
org.languagetool.rules.patterns.RegexRuleFilter
org.languagetool.rules.patterns.RegexAntiPatternFilter
Filters matches that match a regex. Limitations: 1. antipatterns cannot contain spaces,
2. The pipe (|) is used to delimit several patterns and cannot be used inside a pattern.
- Since:
- 5.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacceptRuleMatch(RuleMatch match, Map<String, String> arguments, AnalyzedSentence sentenceObj, Matcher patternMatcher) Returns the original rule match or a modified one, ornullif the rule match is filtered out.
-
Constructor Details
-
RegexAntiPatternFilter
public RegexAntiPatternFilter()
-
-
Method Details
-
acceptRuleMatch
@Nullable public RuleMatch acceptRuleMatch(RuleMatch match, Map<String, String> arguments, AnalyzedSentence sentenceObj, Matcher patternMatcher) Description copied from class:RegexRuleFilterReturns the original rule match or a modified one, ornullif the rule match is filtered out.- Specified by:
acceptRuleMatchin classRegexRuleFilter- Parameters:
arguments- the resolved argument from theargsattribute in the XML.- Returns:
nullif this rule match should be removed, or any other RuleMatch (e.g. the one from the arguments) that properly describes the detected error
-