code: private Set<String> loadWords(InputStream stream) throws IOException {
      Set<String> words = new HashSet<>();
      try (
        InputStreamReader isr = new InputStreamReader(stream, "UTF-8");
        BufferedReader br = new BufferedReader(isr)
      ) {
        String line;
        while ((line = br.readLine()) != null) {
          line = line.trim();
          if (line.isEmpty() || line.charAt(0) == '#') {  // ignore comments
            continue;
          }
          words.add(line);
        }
      }
      return words;
    }
docs: Load list of words from UTF-8 file (one word per line).