class CatalanRepeatedWordsRule extends AbstractRepeatedWordsRule {

private final Supplier<List<DisambiguationPatternRule>> antiPatterns;
  
  private static final List<List<PatternToken>> ANTI_PATTERNS = Arrays
      .asList(
          Arrays.asList(csRegex("[Tt]ema|TEMA"), csRegex("\\d+|[IXVC]+"))
          );
  
  @Override
  public List<DisambiguationPatternRule> getAntiPatterns() {
    return antiPatterns.get();
  }

  public CatalanRepeatedWordsRule(ResourceBundle messages) {
    super(messages, new Catalan());
    antiPatterns = cacheAntiPatterns(new Catalan(), ANTI_PATTERNS);
    super.setTags(Arrays.asList(Tag.picky));
    // super.setDefaultTempOff();
  }

  private static final Map<String, SynonymsData> wordsToCheck = loadWords("/ca/synonyms.txt");

  @Override
  protected String getMessage() {
    return "Aquesta paraula apareix en una de les frases anteriors. Podeu substituir-la per un sinònim per a fer més variat el text, llevat que la repetició sigui intencionada.";
  }

  @Override
  public String getDescription() {
    return ("Sinònims per a paraules repetides.");
  }

  @Override
  protected Map<String, SynonymsData> getWordsToCheck() {
    return wordsToCheck;
  }

  @Override
  protected String getShortMessage() {
    return "Estil: paraula repetida";
  }

  @Override
  protected Synthesizer getSynthesizer() {
    return CatalanSynthesizer.INSTANCE;
  }

  @Override
  protected String adjustPostag(String postag) {<FILL_FUNCTION_BODY>}

  @Override
  protected boolean isException(AnalyzedTokenReadings[] tokens, int i, boolean sentStart, boolean isCapitalized,
      boolean isAllUppercase) {
    if (isAllUppercase || (isCapitalized && !sentStart)) {
      return true;
    }
    if (tokens[i].hasPosTagStartingWith("NP")) {
      return true;
    }
    return false;
  }

}

    if (postag.contains("CN")) {
      return postag.replaceFirst("CN", "..");
    } else if (postag.contains("MS")) {
      return postag.replaceFirst("MS", "[MC][SN]");
    } else if (postag.contains("FS")) {
      return postag.replaceFirst("FS", "[FC][SN]");
    } else if (postag.contains("MP")) {
      return postag.replaceFirst("MP", "[MC][PN]");
    } else if (postag.contains("FP")) {
      return postag.replaceFirst("FP", "[FC][PN]");
    } else if (postag.contains("CS")) {
      return postag.replaceFirst("CS", "[MFC][SN]"); // also F ?
    } else if (postag.contains("CP")) {
      return postag.replaceFirst("CP", "[MFC][PN]"); // also F ?
    } else if (postag.contains("MN")) {
      return postag.replaceFirst("MN", "[MC][SPN]");
    } else if (postag.contains("FN")) {
      return postag.replaceFirst("FN", "[FC][SPN]");
    }
    return postag;
  
<methods>public void <init>(java.util.ResourceBundle, org.languagetool.Language) ,public abstract java.lang.String getDescription() ,public java.lang.String getId() ,public org.languagetool.rules.RuleMatch[] match(List<org.languagetool.AnalyzedSentence>) throws java.io.IOException,public int minToCheckParagraph() <variables>private static final java.lang.String FILE_ENCODING,private static final java.util.regex.Pattern HASH_PATTERN,private static final java.util.regex.Pattern PUNCT_PATTERN,private final non-sealed org.languagetool.Language language,private final non-sealed java.lang.String ruleId