class AbstractSuppressMisspelledSuggestionsFilter extends RuleFilter {

  protected AbstractSuppressMisspelledSuggestionsFilter() {

  }

  @Override
  public RuleMatch acceptRuleMatch(RuleMatch match, Map<String, String> arguments, int patternTokenPos,
                                   AnalyzedTokenReadings[] patternTokens, List<Integer> tokenPositions) throws IOException {<FILL_FUNCTION_BODY>}

  public boolean isMisspelled(String s, Language language) throws IOException {
    SpellingCheckRule spellerRule = language.getDefaultSpellingRule();
    if (spellerRule == null) {
      return false;
    }
    List<String> tokens = language.getWordTokenizer().tokenize(s);
    for (String token : tokens) {
      if (spellerRule.isMisspelled(token)) {
        return true;
      };
    }
    return false;
  }

}

    RuleMatch ruleMatch = match;
    Language language = ((PatternRule) match.getRule()).getLanguage();
    Tagger tagger = language.getTagger();
    List<String> replacements = match.getSuggestedReplacements();
    List<String> newReplacements = new ArrayList<>();
    String suppressMatch = getRequired("suppressMatch", arguments);
    String suppressPostag = getOptional("SuppressPostag", arguments);
    List<AnalyzedTokenReadings> atrs = new ArrayList<>();
    if (tagger != null && suppressPostag != null) {
      atrs = tagger.tag(replacements);
    }
    for (int i = 0; i < replacements.size(); i++) {
      if (!isMisspelled(replacements.get(i), language)) {
        if (tagger != null && suppressPostag != null) {
          if (!atrs.get(i).matchesPosTagRegex(suppressPostag)) {
            newReplacements.add(replacements.get(i));
          }
        } else {
          newReplacements.add(replacements.get(i));
        }
      }
    }
    boolean bSuppressMatch = true;
    if (suppressMatch != null && suppressMatch.equalsIgnoreCase("false")) {
      bSuppressMatch = false;
    }
    if (newReplacements.isEmpty() && bSuppressMatch) {
      return null;
    } else {
      ruleMatch.setSuggestedReplacements(newReplacements);
      return ruleMatch;
    }
  
<methods>public non-sealed void <init>() ,public abstract org.languagetool.rules.RuleMatch acceptRuleMatch(org.languagetool.rules.RuleMatch, Map<java.lang.String,java.lang.String>, int, org.languagetool.AnalyzedTokenReadings[], List<java.lang.Integer>) throws java.io.IOException,public boolean matches(Map<java.lang.String,java.lang.String>, org.languagetool.AnalyzedTokenReadings[], int, List<java.lang.Integer>) throws java.io.IOException<variables>