Class RegexAntiPatternFilter

java.lang.Object
org.languagetool.rules.patterns.RegexRuleFilter
org.languagetool.rules.patterns.RegexAntiPatternFilter

public class RegexAntiPatternFilter extends RegexRuleFilter
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 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: RegexRuleFilter
      Returns the original rule match or a modified one, or null if the rule match is filtered out.
      Specified by:
      acceptRuleMatch in class RegexRuleFilter
      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