languagetool-org/languagetool · error · IOException

Unknown line format when loading manual synthesizer dictiona

Error message

Unknown line format when loading manual synthesizer dictionary, expected 3 parts separated by '" + separator + "', found " + parts.length + ": '" + line + "'

What it means

Error "Unknown line format when loading manual synthesizer dictionary, expected 3 parts separated by '" + separator + "', found " + parts.length + ": '" + line + "'" thrown in languagetool-org/languagetool.

Source

Thrown at languagetool-core/src/main/java/org/languagetool/synthesis/ManualSynthesizer.java:208

  }

  private static Map<TaggedWord, List<String>> loadMapping(InputStream inputStream) throws IOException {
    Map<TaggedWord, List<String>> mapping = new HashMap<>();
    try (Scanner scanner = new Scanner(inputStream, StandardCharsets.UTF_8)) {
      String separator = DEFAULT_SEPARATOR;
      while (scanner.hasNextLine()) {
        String line = scanner.nextLine();
        line = line.trim();
        if (line.startsWith("#separatorRegExp=")) {
          separator = line.replace("#separatorRegExp=", "");
        }
        if (StringTools.isEmpty(line) || line.charAt(0) == '#') {
          continue;
        }
        line = StringUtils.substringBefore(line, "#").trim();
        String[] parts = line.split(separator);
        if (parts.length != 3) {
          throw new IOException("Unknown line format when loading manual synthesizer dictionary, " +
            "expected 3 parts separated by '" + separator + "', found " + parts.length + ": '" + line + "'");
        }
        String form = parts[0];
        String lemma = parts[1];
        if (form.equals(lemma)) {
          form = lemma;
        }
        lemma = intern(lemma);
        String posTag = intern(parts[2]);
        mapping.computeIfAbsent(new TaggedWord(lemma, posTag), __ -> new ArrayList<>()).add(form);
      }
    }
    return mapping;
  }

}

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Fix the offending line in the manual synthesizer .txt file so it has exactly inflected-form, separator, and form parts
  2. Check whether a #separatorRegExp= header changed the expected separator and reformat lines accordingly
  3. Remove stray separators inside fields or extra trailing separators
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at languagetool-core/src/main/java/org/languagetool/synthesis/ManualSynthesizer.java:208 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06). Data as JSON: /api/errors/52bb321060b10e33. Report an issue: GitHub.