languagetool-org/languagetool · error · RuntimeException

Could not tag word '" + word + "'

Error message

Could not tag word '" + word + "'

What it means

Wraps RuntimeExceptions from the dictionary lookup while tagging a single word in MorfologikTagger.tag(). It indicates a low-level failure (dictionary access or decode error) during stemming of that specific word, not merely an unknown word — unknown words normally just yield an empty result.

Source

Thrown at languagetool-core/src/main/java/org/languagetool/tagging/MorfologikTagger.java:96

  @Override
  public List<TaggedWord> tag(String word) {
    List<TaggedWord> result = new ArrayList<>();
    try {
      IStemmer dictLookup = new DictionaryLookup(getDictionary());
      List<WordData> lookup = dictLookup.lookup(word);
      for (WordData wordData : lookup) {
        String tag = wordData.getTag() == null ? null : wordData.getTag().toString();
        // Remove frequency data from tags (if exists)
        // The frequency data is in the last byte (without a separator)
        if (dictionary.metadata.isFrequencyIncluded() && tag != null && tag.length() > 1) {
          tag = tag.substring(0, tag.length() - 1);
        }
        String stem = wordData.getStem() == null ? null : wordData.getStem().toString();
        TaggedWord taggedWord = new TaggedWord(stem, (internTags && tag != null) ? tag.intern() : tag);
        result.add(taggedWord);
      }
    } catch (IOException e) {
      throw new RuntimeException("Could not tag word '" + word + "'", e);
    }
    return result;
  }

}

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Inspect the wrapped cause for dictionary load/decode problems
  2. Verify the language's .dict and .info metadata files are consistent and correctly packaged
  3. Check the input word for corrupt characters or surrogates
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at languagetool-core/src/main/java/org/languagetool/tagging/MorfologikTagger.java:96 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/07aa5b5cfed228d7. Report an issue: GitHub.