class SpellCheckEvaluation {
  
  private static final int MAX_SUGGESTIONS = 5;

  private void run(Language language, File file) throws IOException {
    JLanguageTool lt = getLanguageToolForSpellCheck(language);
    checkFile(file, lt);
  }

  private JLanguageTool getLanguageToolForSpellCheck(Language language) {
    JLanguageTool lt = new JLanguageTool(language);
    for (Rule rule : lt.getAllActiveRules()) {
      if (!rule.isDictionaryBasedSpellingRule()) {
        lt.disableRule(rule.getId());
      }
    }
    return lt;
  }

  private void checkFile(File file, JLanguageTool lt) throws IOException {<FILL_FUNCTION_BODY>}

  public static void main(String[] args) throws IOException {
    if (args.length != 2) {
      System.out.println("Usage: " + SpellCheckEvaluation.class.getSimpleName() + " <langCode> <textFile>");
      System.exit(1);
    }
    SpellCheckEvaluation eval = new SpellCheckEvaluation();
    eval.run(Languages.getLanguageForShortCode(args[0]), new File(args[1]));
  }
}

    try (
      FileInputStream fis = new FileInputStream(file);
      InputStreamReader reader = new InputStreamReader(fis, "utf-8");
      BufferedReader br = new BufferedReader(reader)
    ) {
      String line;
      while ((line = br.readLine()) != null) {
        List<RuleMatch> matches = lt.check(line);
        for (RuleMatch match : matches) {
          String covered = line.substring(match.getFromPos(), match.getToPos());
          List<String> suggestions = match.getSuggestedReplacements();
          List<String> limitedSuggestions = suggestions.subList(0, Math.min(MAX_SUGGESTIONS, suggestions.size()));
          System.out.println(covered + ": " + limitedSuggestions);
        }
      }
    }
  
<no_super_class>