class PortugueseBarbarismsRule extends AbstractSimpleReplaceRule2 {

  public static final String PT_BARBARISMS_REPLACE = "PT_BARBARISMS_REPLACE";

  private static final Locale PT_LOCALE = new Locale("pt");  // locale used on case-conversion

  private final String path;

  @Override
  public List<String> getFileNames() {
    return Collections.singletonList(path);
  }

  public PortugueseBarbarismsRule(ResourceBundle messages, String path, Language language) {
    super(messages, language);
    this.path = Objects.requireNonNull(path);
    setCategory(Categories.STYLE.getCategory(messages));
    setLocQualityIssueType(ITSIssueType.LocaleViolation);
    useSubRuleSpecificIds();
    addExamplePair(Example.wrong("<marker>curriculum vitae</marker>"),
                   Example.fixed("<marker>currículo</marker>"));
  }

  @Override
  public String getId() {
    return PT_BARBARISMS_REPLACE;
  }

  @Override
  public String getDescription() {
    return "Palavras de origem estrangeira evitáveis: $match";
  }

  @Override
  public String getShort() {
    return "Estrangeirismo";
  }

  @Override
  public String getMessage() {
    return "\"$match\" é um estrangeirismo. É preferível dizer $suggestions.";
  }

  @Override
  public String getSuggestionsSeparator() {
    return " ou ";
  }

  @Override
  public URL getUrl() {
    return Tools.getUrl("https://pt.wikipedia.org/wiki/Estrangeirismo");
  }

  @Override
  public Locale getLocale() {
    return PT_LOCALE;
  }
  
  @Override
  protected boolean isTokenException(AnalyzedTokenReadings atr) {<FILL_FUNCTION_BODY>}

}

    // proper nouns tagged in multiwords are exceptions
    return atr.hasPosTagStartingWith("NP") || atr.isImmunized();
  
<methods>public void <init>(java.util.ResourceBundle, org.languagetool.Language) ,public boolean checkKeyWordsAreKnownToSpeller() ,public boolean checkKeyWordsAreUnknownToSpeller() ,public org.languagetool.rules.AbstractSimpleReplaceRule2.CaseSensitivy getCaseSensitivy() ,public abstract java.lang.String getDescription() ,public java.lang.String getDescription(java.lang.String) ,public abstract List<java.lang.String> getFileNames() ,public List<java.net.URL> getFilePaths() ,public abstract java.lang.String getId() ,public abstract java.util.Locale getLocale() ,public abstract java.lang.String getMessage() ,public abstract java.lang.String getShort() ,public java.lang.String getSuggestionsSeparator() ,public List<Map<java.lang.String,org.languagetool.rules.SuggestionWithMessage>> getWrongWords() ,public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence) ,public boolean separateKeyWordsBySpeller() ,public void useSubRuleSpecificIds() <variables>private int MAX_LENGTH_SHORT_WORDS,private static final int MAX_TOKENS_IN_MULTIWORD,private boolean ignoreShortUppercaseWords,private volatile boolean initialized,protected final non-sealed org.languagetool.Language language,private Map<java.lang.String,org.languagetool.rules.SuggestionWithMessage> mFullNoSpace,private Map<java.lang.String,org.languagetool.rules.SuggestionWithMessage> mFullSpace,private Map<java.lang.String,java.lang.Integer> mStartNoSpace,private Map<java.lang.String,java.lang.Integer> mStartSpace,private boolean ruleHasSuggestions,protected boolean subRuleSpecificIds