Package org.languagetool.rules.patterns
Class RegexRuleFilter
java.lang.Object
org.languagetool.rules.patterns.RegexRuleFilter
- Direct Known Subclasses:
BrazilianToponymFilter,RegexAntiPatternFilter
Filter rule matches after a RegexPatternRule has matched already.
Can be used from the XML using the
filter element.- Since:
- 5.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract RuleMatchacceptRuleMatch(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
-
RegexRuleFilter
public RegexRuleFilter()
-
-
Method Details
-
acceptRuleMatch
@Nullable public abstract RuleMatch acceptRuleMatch(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.- 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
-