class HomophoneExtractor {
  
  private static final Pattern homophonePattern = Pattern.compile("\\{\\{homophones\\|(.*?)\\}\\}");

  private void run(String filename) throws FileNotFoundException {<FILL_FUNCTION_BODY>}

  public static void main(String[] args) throws FileNotFoundException {
    if (args.length != 1) {
      System.out.println("Usage: " + HomophoneExtractor.class.getSimpleName() + " <xmlFilename>");
      System.out.println("       <xmlFilename> is an unpacked Wiktionary dump");
      System.exit(1);
    }
    HomophoneExtractor extractor = new HomophoneExtractor();
    extractor.run(args[0]);
  }

}

    try (Scanner scanner = new Scanner(new File(filename))) {
      String title = "";
      int lineCount = 0;
      long startTime = System.currentTimeMillis();
      while (scanner.hasNextLine()) {
        String line = scanner.nextLine();
        lineCount++;
        if (line.contains("<title>") && line.contains("</title>")) {
          title = line.substring(line.indexOf("<title>") + 7, line.indexOf("</title>"));
        } else if (line.contains("lang=en")) {
          Matcher m = homophonePattern.matcher(line);
          if (m.find()) {
            String homophonesData = m.group(1).replaceFirst("\\|?lang=en\\|?", "");
            String[] homophones = homophonesData.split("\\|");
            List<String> allHomophones = new ArrayList<>();
            allHomophones.add(title);
            allHomophones.addAll(Arrays.asList(homophones));
            allHomophones.sort(null);
            System.out.println(String.join(", ", allHomophones));
          }
        }
        if (lineCount % 100_000 == 0) {
          long endTime = System.currentTimeMillis();
          System.err.println(lineCount  + " (" + (endTime-startTime) + "ms)...");
          startTime = System.currentTimeMillis();
        }
      }
    }
  
<no_super_class>