class CatalanNumberSpellerFilter extends RuleFilter {
  
  private final Language language = new Catalan();
  private final CatalanSynthesizer synth = (CatalanSynthesizer) language.getSynthesizer();

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

}


    String strToSpell = getRequired("number_to_spell", arguments).replaceAll("\\.", "");
    if (getRequired("gender", arguments).contentEquals("feminine")) {
      strToSpell = "feminine " + strToSpell;
    }
    String spelledNumber = synth.getSpelledNumber(strToSpell);
    if (!spelledNumber.isEmpty() && spelledNumber.replaceAll("-i-", " ").replaceAll("-", " ").split(" ").length < 4) {
      String message = match.getMessage();
      RuleMatch ruleMatch = new RuleMatch(match.getRule(), match.getSentence(), match.getFromPos(), match.getToPos(),
          message, match.getShortMessage());
      ruleMatch.setType(match.getType());
      ruleMatch.setSuggestedReplacement(spelledNumber);
      return ruleMatch;
    } else {
      return null;
    }

  
<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>