class DictionaryMatchFilter implements RuleMatchFilter {
  private final UserConfig userConfig;

  public DictionaryMatchFilter(UserConfig userConfig) {
    this.userConfig = userConfig;
  }

  @Override
  public List<RuleMatch> filter(List<RuleMatch> ruleMatches, AnnotatedText text) {<FILL_FUNCTION_BODY>}
}

    Set<String> dictionary = new HashSet<>(userConfig.getAcceptedWords());

    return ruleMatches.stream().filter(match -> {
      // at this point, the offsets we get from match are already converted to be pointing to the text with markup
      // so we need to compute the substring based on that
      // using anything else leads to StringIndexOutOfBoundsErrors or getting the wrong text
      // if there's no markup, this is just equal to the original text
      String covered = text.getTextWithMarkup().substring(match.getFromPos(), match.getToPos());
      return !dictionary.contains(covered);
    }).collect(Collectors.toList());
  
<no_super_class>