code: private static List<Map<String, String>> loadWords(InputStream stream) {
      List<Map<String, String>> list = new ArrayList<>();
      try (
        InputStreamReader isr = new InputStreamReader(stream, FILE_ENCODING);
        BufferedReader br = new BufferedReader(isr);
      ) {
        String line;
  
        Tokenizer wordTokenizer = new Breton().getWordTokenizer();
        while ((line = br.readLine()) != null) {
          line = line.trim();
          if (line.isEmpty() || line.charAt(0) == '#') { // ignore comments
            continue;
          }
          String[] parts = line.split("=");
          if (parts.length != 2) {
            throw new IOException("Format error in file "
                    + JLanguageTool.getDataBroker().getFromRulesDirAsUrl(FILE_NAME)
                    + ", line: " + line);
          }
          String[] wrongForms = parts[0].split("\\|"); // multiple incorrect forms
          for (String wrongForm : wrongForms) {
            int wordCount = 0;
            List<String> tokens = wordTokenizer.tokenize(wrongForm);
            for (String token : tokens) {
              if (!StringTools.isWhitespace(token)) {
                wordCount++;
              }
            }
            // grow if necessary
            for (int i = list.size(); i < wordCount; i++) {
              list.add(new HashMap<>());
            }
            list.get(wordCount - 1).put(wrongForm, parts[1]);
          }
        }
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
      // seal the result (prevent modification from outside this class)
      List<Map<String,String>> result = new ArrayList<>();
      for (Map<String, String> map : list) {
        result.add(Collections.unmodifiableMap(map));
      }
      return Collections.unmodifiableList(result);
    }
docs: Load the list of words. Same as {@link AbstractSimpleReplaceRule#loadFromPath} but allows multiple words.
  @param stream the stream to load.
  @return the list of maps containing the error-corrections pairs. The n-th map contains key strings of (n+1) words.