class AbstractNumberInWordFilter extends RuleFilter {

  protected final Language language;

  public static final Pattern typoPattern = Pattern.compile("[0-9]");

  protected AbstractNumberInWordFilter(Language language) {
    this.language = language;
  }

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

  protected abstract boolean isMisspelled(String word) throws IOException;

  protected abstract List<String> getSuggestions(String word) throws IOException;

}

    String word = arguments.get("word");
    String wordReplacingZeroO = word.replaceAll("0","o");
    String wordWithoutNumberCharacter = typoPattern.matcher(word).replaceAll("");
    List<String> replacements = new ArrayList<>();
    
    if (!isMisspelled(wordReplacingZeroO) && !word.equals(wordReplacingZeroO) ) {
      replacements.add(wordReplacingZeroO);
    }
    if (!isMisspelled(wordWithoutNumberCharacter)) {
      replacements.add(wordWithoutNumberCharacter);
    } 
    if (replacements.isEmpty()){
      List<String> suggestions = getSuggestions(wordWithoutNumberCharacter);
      replacements.addAll(suggestions);
    }
    if (!replacements.isEmpty()) {
      RuleMatch ruleMatch = new RuleMatch(match);
      ruleMatch.setSuggestedReplacements(replacements);
      return ruleMatch;
    }
    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>