class AutomaticConfusionRuleEvaluatorFilter {
  
  private final static float MIN_PRECISION = 0.99f; 
  private final static int MIN_OCCURRENCES = 25; 

  private AutomaticConfusionRuleEvaluatorFilter() {
  }

  private static String reformat(String s) {
    int spaceStart = s.indexOf("0;");
    if (spaceStart == -1) {
      spaceStart = s.indexOf("1;");
    }
    int spaceEnd = s.indexOf('#');
    if (spaceStart > 0 && spaceEnd > 0) {
      String spaces = StringUtils.repeat(" ", 52-spaceStart);
      return s.substring(0, spaceStart+2) + spaces + s.substring(spaceEnd);
    }
    return s;
  }
  
  public static void main(String[] args) throws IOException {<FILL_FUNCTION_BODY>}
  
}

    if (args.length != 1) {
      System.out.println("Usage: " + AutomaticConfusionRuleEvaluatorFilter.class.getSimpleName() + " <file>");
      System.out.println("       <file> is the output of " + AutomaticConfusionRuleEvaluator.class.getName());
      System.exit(0);
    }
    List<String> lines = Files.readAllLines(Paths.get(args[0]), StandardCharsets.UTF_8);
    String prevKey = null;
    int skippedCount = 0;
    int lowPrecisionCount = 0;
    int lowOccurrenceCount = 0;
    int usedCount = 0;
    boolean skipping = false;
    for (String line : lines) {
      if (!line.startsWith("=>")) {
        continue;
      }
      String cleanLine = line.replaceFirst("=> ", "").replaceFirst("; \\d.*", "");
      String[] parts;
      boolean bothDirections;
      if (cleanLine.contains("->")) {
        parts = cleanLine.split("\\s*->\\s*");
        bothDirections = false;
      } else {
        parts = cleanLine.split(";\\s*");
        bothDirections = true;
      }
      String key = parts[0] + ";" + parts[1];
      Pattern data = Pattern.compile("^(.+?)(?:;| ->) (.+?);.*p=(\\d\\.\\d+), r=(\\d\\.\\d+), f0.5=\\d\\.\\d+, (\\d+)\\+(\\d+),.*");
      Matcher m = data.matcher(line.replaceFirst("=> ", ""));
      m.find();
      String word1 = m.group(1);
      String word2 = m.group(2);
      String delim = bothDirections ? "; " : " -> ";
      String wordGroup = word1 + delim + word2;
      if (word1.compareTo(word2) > 0 && bothDirections) {
        wordGroup = word2 + delim + word1;
      }
      float precision = Float.parseFloat(m.group(3));
      int occ1 = Integer.parseInt(m.group(5));
      int occ2 = Integer.parseInt(m.group(6));
      if (key.equals(prevKey)) {
        if (skipping) {
          //System.out.println("SKIP: " + reformat(line));
        }
      } else {
        if (precision < MIN_PRECISION) {
          lowPrecisionCount++;
          skippedCount++;
          skipping = true;
          continue;
        }
        if (occ1 < MIN_OCCURRENCES || occ2 < MIN_OCCURRENCES) {
          lowOccurrenceCount++;
          skippedCount++;
          skipping = true;
          continue;
        }
        System.out.println(reformat(line.replaceFirst("=> .+?(;| ->) .+?; ", wordGroup + "; ")));
        skipping = false;
        usedCount++;
      }
      prevKey = key;
    }
    System.err.println("Skipped: " + skippedCount);
    System.err.println("lowPrecisionCount: " + lowPrecisionCount);
    System.err.println("lowOccurrences: " + lowOccurrenceCount);
    System.err.println("Used: " + usedCount);
  
<no_super_class>