class RareWordsFinder {

  private static final String dictInClassPath = "/en/hunspell/en_US.dict";
  
  private final HunspellDictionary hunspell;
  
  private RareWordsFinder(String hunspellBase) throws IOException {
    hunspell = Hunspell.getDictionary(Paths.get(hunspellBase + ".dic"), Paths.get(hunspellBase + ".aff"));
  }
  
  private void run(File input, int minimum) throws FileNotFoundException, CharacterCodingException {<FILL_FUNCTION_BODY>}

  private boolean suggestionsMightBeUseful(String word, List<String> suggestions) {
    return suggestions.size() > 0 &&
            !suggestions.get(0).contains(" ") &&
            !suggestions.get(0).equals(word + "s") &&
            !suggestions.get(0).equals(word.replaceFirst("s$", ""));
  }

  public static void main(String[] args) throws IOException {
    if (args.length != 3) {
      System.out.println("Usage: " + RareWordsFinder.class.getSimpleName() + " <wordFile> <hunspellBase> <limit>");
      System.out.println("    <wordFile> is a word file with occurrence counts, separated by tabs");
      System.out.println("    <hunspellBase> is the hunspell file without suffix, e.g. '/path/to/en_US'");
      System.out.println("    <limit> only words with this many or less occurrences are considered");
      System.exit(1);
    }
    RareWordsFinder finder = new RareWordsFinder(args[1]);
    File input = new File(args[0]);
    int minimum = Integer.parseInt(args[2]);
    finder.run(input, minimum);
  }
  
}

    MorfologikSpeller speller = new MorfologikSpeller(dictInClassPath, 1);
    int lineCount = 0;
    int wordCount = 0;
    try (Scanner s = new Scanner(input)) {
      while (s.hasNextLine()) {
        String line = s.nextLine();
        String[] parts = line.split("\t");
        String word = parts[0];
        long count = Long.parseLong(parts[1]);
        if (count <= minimum) {
          if (word.matches("[a-zA-Z]+") && !word.matches("[A-Z]+") && !word.matches("[a-zA-Z]+[A-Z]+[a-zA-Z]*") && !word.matches("[A-Z].*")) {
            boolean isMisspelled = speller.isMisspelled(word);
            if (!isMisspelled) {
              //List<String> suggestions = speller.getSuggestions(word);  // seems to work only for words that are actually misspellings
              List<String> suggestions = hunspell.suggest(word);
              suggestions.remove(word);
              if (suggestionsMightBeUseful(word, suggestions)) {
                System.out.println(word + "\t" + count + " -> " + String.join(", ", suggestions));
                wordCount++;
              }
            }
          }
        }
        lineCount++;
        if (lineCount % 1_000_000 == 0) {
          System.out.println("lineCount: " + lineCount + ", words found: " + wordCount);
        }
      }
      System.out.println("Done. lineCount: " + lineCount + ", words found: " + wordCount);
    }
  
<no_super_class>