languagetool-org/languagetool · error
Could not tag and disambiguate '<token>'
Error message
Could not tag and disambiguate '<token>'
What it means
IrishPartialPosTagFilter.tag wraps the Irish tagger/disambiguator calls; if either throws an IOException (dictionary read failure, resource loading problem), it is rethrown as this RuntimeException naming the token being processed. It means a single token could not be analyzed during partial POS filtering.
Source
Thrown at languagetool-language-modules/ga/src/main/java/org/languagetool/rules/ga/IrishPartialPosTagFilter.java:52
* will apply that have a single {@code <match>} element.
* <b>Warning: Do not use this in disambiguation.xml, it would cause an endless loop,
* use {@link NoDisambiguationIrishPartialPosTagFilter} instead.</b>
*
* @since 2.8
* @see NoDisambiguationIrishPartialPosTagFilter
*/
public class IrishPartialPosTagFilter extends PartialPosTagFilter {
@Override
protected List<AnalyzedTokenReadings> tag(String token) {
try {
var irishLanguage = Irish.getInstance();
List<AnalyzedTokenReadings> tags = irishLanguage.getTagger().tag(Collections.singletonList(token));
AnalyzedTokenReadings[] atr = tags.toArray(new AnalyzedTokenReadings[tags.size()]);
AnalyzedSentence disambiguated = irishLanguage.getDisambiguator().disambiguate(new AnalyzedSentence(atr));
return Arrays.asList(disambiguated.getTokens());
} catch (IOException e) {
throw new RuntimeException("Could not tag and disambiguate '" + token + "'", e);
}
}
}
View on GitHub (pinned to 2e990059ce)
Solutions
- Check the cause (IOException) for the missing resource path and restore the Irish tagger/dictionary resources on the classpath.
- Reinstall or redownload the full languagetool-language-modules/ga artifact.
- Verify resource files are readable by the process user.
- If building a custom distribution, ensure the tagger's resource files are included in the jar and loaded via the classloader, not the filesystem.
Example fix
// before (stripped jar) jar without src/main/resources/org/languagetool/tagger/ga/* // after include all irish tagger/disambiguator resources in the build (maven-resources or shade config)
Defensive patterns
Strategy: try-catch
Validate before calling
// verify resources once at startup
try (InputStream in = getClass().getResourceAsStream("/org/languagetool/tagger/ga/irish.dict")) {
if (in == null) throw new IllegalStateException("Irish tagger resources missing from classpath");
} Try / catch
try { return filter.tag(token); } catch (RuntimeException e) { log.error("Tagging failed for '" + token + "'", e.getCause()); return Collections.emptyList(); } Prevention
- Smoke-test language resource loading at application startup
- Verify fat-jar/shade builds include all resources under org/languagetool/tagger/ga
- Check file permissions after installing/upgrading LanguageTool
When it happens
Trigger: irishLanguage.getTagger().tag(...) or getDisambiguator().disambiguate(...) throws IOException while processing a token — typically missing/corrupt Irish tagging resources on the classpath or an I/O error reading dictionary files.
Common situations: Incomplete LanguageTool installation missing Irish dictionaries; fat-jar packaging that dropped resource files; read-permission problems on installed resources; running with a stripped classpath.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- Could not tag and disambiguate '<token>'
- Could not load coherency data from " + path
- Could not tag and disambiguate '" + token + "'
- Error analyzing sentence: '" + match.getSentence().getText()
- Language was already instantiated, see the cause stacktrace
AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06).
Data as JSON: /api/errors/7c584a165e0dcd00.
Report an issue: GitHub.