Class RegexRuleFilter

java.lang.Object
org.languagetool.rules.patterns.RegexRuleFilter
Direct Known Subclasses:
BrazilianToponymFilter, RegexAntiPatternFilter

public abstract class RegexRuleFilter extends Object
Filter rule matches after a RegexPatternRule has matched already. Can be used from the XML using the filter element.
Since:
5.2
  • 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, or null if the rule match is filtered out.
      Parameters:
      arguments - the resolved argument from the args attribute in the XML.
      Returns:
      null if this rule match should be removed, or any other RuleMatch (e.g. the one from the arguments) that properly describes the detected error