languagetool-org/languagetool · error · IOException

Unknown line format in line " + lineCount + " when loading m

Error message

Unknown line format in line " + lineCount + " when loading manual tagger dictionary, expected three tab-separated fields: '" + line + "'

What it means

Format validation in loadMapping for the manual tagger dictionary: after honoring any #separatorRegExp= header, a non-comment line does not split into exactly three fields (inflected form, lemma, POS). Fires on lines with too few/many tabs, wrong separator, or merged columns in added.txt.

Source

Thrown at languagetool-core/src/main/java/org/languagetool/tagging/ManualTagger.java:110

      String line;
      int lineCount = 0;
      String separator = DEFAULT_SEPARATOR;
      while ((line = br.readLine()) != null) {
        line = line.trim();
        lineCount++;
        if (line.startsWith("#separatorRegExp=")) {
          separator = line.replace("#separatorRegExp=", "");
        }
        if (StringTools.isEmpty(line) || line.charAt(0) == '#') {
          continue;
        }
        if (line.contains("\u00A0")) {
          throw new RuntimeException("Non-breaking space found in line #" + lineCount + ": '" + line + "', please remove it");
        }
        line = StringUtils.substringBefore(line, "#").trim();
        String[] parts = line.split(separator);
        if (parts.length != 3) {
          throw new IOException("Unknown line format in line " + lineCount + " when loading manual tagger dictionary, " +
            "expected three tab-separated fields: '" + line + "'");
        }
        String form = parts[0];

        String lemma = parts[1];
        if (lemma.equals(form)) lemma = form;
        lemma = intern(lemma);

        String tag = parts[2].trim();
        String internedTag = internTags ? tag.intern() : intern(tag);
        map.computeIfAbsent(form, __ -> new ArrayList<>()).add(new TaggedWord(lemma, internedTag));
      }
    }
    return map;
  }

  /**
   * Look up a word's baseform (lemma) and POS information.

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Rewrite the cited line to have exactly three tab-separated fields: word, lemma, POS tag
  2. Check for a #separatorRegExp= header that redefines the expected separator
  3. Remove embedded separator characters from within fields
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at languagetool-core/src/main/java/org/languagetool/tagging/ManualTagger.java:110 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/284ef30956e28f1c. Report an issue: GitHub.