languagetool-org/languagetool · error · RuntimeException

Non-breaking space found in line #" + lineCount + ": '" + li

Error message

Non-breaking space found in line #" + lineCount + ": '" + line + "', please remove it

What it means

Input validation while parsing the manual tagging dictionary: a line contains U+00A0, which looks like a normal space but breaks tokenization and separator splitting silently. The loader refuses the whole file up front so authors fix the source file rather than get wrong tags.

Source

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

    Map<String, List<TaggedWord>> map = new HashMap<>();
    try (
      InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
      BufferedReader br = new BufferedReader(reader)
    ) {
      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));
      }
    }

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Replace the non-breaking space (U+00A0) on the given line with a regular space
  2. Re-save the file with a plain editor or run a sanitizer like sed 's/\xC2\xA0/ /g'
  3. Enable editor 'show whitespace' to spot invisible NBSPs
Defensive patterns

Strategy: validation

When it happens

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