class SimpleReplaceSoftRule extends AbstractSimpleReplaceRule {

  private static final String CONTEXT_PREFIX = "ctx:";
  private static final Map<String, List<String>> WRONG_WORDS = loadFromPath("/uk/replace_soft.txt");

  @Override
  public Map<String, List<String>> getWrongWords() {
    return WRONG_WORDS;
  }

  public SimpleReplaceSoftRule(ResourceBundle messages, Language language) throws IOException {
    super(messages, language);
    setLocQualityIssueType(ITSIssueType.Style);
  }

  @Override
  public final String getId() {
    return "UK_SIMPLE_REPLACE_SOFT";
  }

  @Override
  public String getDescription() {
    return "Пошук нерекомендованих слів";
  }

  @Override
  public String getShort() {
    return "Нерекомендоване слово";
  }

  @Override
  public String getMessage(String tokenStr, List<String> replacements) {<FILL_FUNCTION_BODY>}

  @Override
  protected boolean isTokenException(AnalyzedTokenReadings atr) {
    // завидна - could be normal adv
    return "завидна".equals(atr.getCleanToken()) || super.isTokenException(atr);
  }
  
  @Override
  public boolean isCaseSensitive() {
    return false;
  }

  private static ContextRepl findContext(List<String> replacements) {
    ContextRepl contextRepl = new ContextRepl();
    
    for (String replacement: replacements) {
      if( replacement.startsWith(CONTEXT_PREFIX) ) {
        contextRepl.contexts.addAll(Arrays.asList(replacement.replace(CONTEXT_PREFIX, "").trim().split(", *")));
      } else {
        contextRepl.replacements.add(replacement);
      }
    }
    
    return contextRepl;
  }

  private static final class ContextRepl {
    final List<String> contexts = new ArrayList<>();
    final List<String> replacements = new ArrayList<>();
  }
  
}

    ContextRepl repl = findContext(replacements);
    String replaceText = StringUtils.join(repl.replacements, ", ");

    // this is a bit ugly as we're modifying original list
    replacements.retainAll(repl.replacements);
    
    if( repl.contexts.size() > 0 ) {
      return "«" + tokenStr + "» вживається лише в таких контекстах: " 
          + StringUtils.join(repl.contexts, ", ")
          + ", можливо, ви мали на увазі: " + replaceText + "?";
    }

    return "«" + tokenStr + "» — нерекомендоване слово, кращий варіант: " + replaceText + ".";
  
<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