class AbstractSimpleReplaceLemmasRule extends AbstractSimpleReplaceRule {

  protected Map<String, List<String>> wrongLemmas = null;
  private static final Locale CA_LOCALE = new Locale("CA");
  private CatalanSynthesizer synth;
  
  public AbstractSimpleReplaceLemmasRule(final ResourceBundle messages, Language language) throws IOException {
    super(messages, language);
    //this.setIgnoreTaggedWords();
    synth = (CatalanSynthesizer) language.getSynthesizer();
  }  
  
  @Override
  public Map<String, List<String>> getWrongWords() {
    return wrongLemmas;
  }
  
  @Override
  public boolean isCaseSensitive() {
    return false;
  }
  
  @Override
  public Locale getLocale() {
    return CA_LOCALE;
  }
  
  @Override
  public final RuleMatch[] match(final AnalyzedSentence sentence) {<FILL_FUNCTION_BODY>}
}

    List<RuleMatch> ruleMatches = new ArrayList<>();
    AnalyzedTokenReadings[] tokens = sentence.getTokensWithoutWhitespace();
    String originalLemma = null;
    for (int i=1; i<tokens.length; i++) {
      List<String> replacementLemmas = null; 
      String replacePOSTag = null;
      boolean bRuleMatches = false;
      for (AnalyzedToken at: tokens[i].getReadings()){
        if (getWrongWords().containsKey(at.getLemma())) {
          replacementLemmas = getWrongWords().get(at.getLemma());
          replacePOSTag = at.getPOSTag();
          bRuleMatches = true;
          originalLemma=at.getLemma();
          break;
        }
      }
      // find suggestions
      List<String> possibleReplacements = new ArrayList<>();
      if (replacementLemmas != null && replacePOSTag != null) {     
        String[] synthesized = null;
        // synthesize replacements
        for (String replacementLemma : replacementLemmas) {
          try {
            synthesized = synth.synthesize(new AnalyzedToken(replacementLemma, replacePOSTag, replacementLemma),
                replacePOSTag);
          } catch (IOException e) {
            throw new RuntimeException("Could not synthesize: " + replacementLemma + " with tag " + replacePOSTag, e);
          } // try with another gender
          if (synthesized.length == 0) {
            try {
              String replacePOSTag2 = replacePOSTag.replaceAll("[MFC]S",".S").replaceAll("[MFC]P",".P");
              synthesized = synth.synthesize(new AnalyzedToken(replacementLemma, replacePOSTag, replacementLemma), replacePOSTag2);
            } catch (IOException e) {
              throw new RuntimeException("Could not synthesize: " + replacementLemma + " with tag " + replacePOSTag, e);
            }   
          } // add the suggestion without inflection
          if (synthesized.length == 0 && replacementLemma.length()>1) {
            possibleReplacements.add(replacementLemma);
          } else {
            possibleReplacements.addAll(Arrays.asList(synthesized));
          }
        }
      }
      if (bRuleMatches) {
        RuleMatch potentialRuleMatch = createRuleMatch(tokens[i], possibleReplacements, sentence, originalLemma);
        ruleMatches.add(potentialRuleMatch);
      }
    }
    return toRuleMatchArray(ruleMatches);
  
<methods>public void <init>(java.util.ResourceBundle, org.languagetool.Language) ,public java.lang.String getDescription() ,public java.lang.String getId() ,public java.util.Locale getLocale() ,public java.lang.String getMessage(java.lang.String, List<java.lang.String>) ,public java.lang.String getShort() ,public org.languagetool.synthesis.Synthesizer getSynthesizer() ,public abstract Map<java.lang.String,List<java.lang.String>> getWrongWords() ,public boolean isCaseSensitive() ,public boolean isCheckLemmas() ,public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence) throws java.io.IOException,public void setCheckLemmas(boolean) ,public void setIgnoreTaggedWords() ,public void useSubRuleSpecificIds() <variables>private boolean checkLemmas,protected boolean ignoreTaggedWords,private final non-sealed org.languagetool.Language language,private static final Logger logger,protected boolean subRuleSpecificIds