{"record":{"id":"88ab02cca8a094ee","repo":"languagetool-org/languagetool","slug":"could-not-tag-and-disambiguate-token-88ab02","errorCode":null,"errorMessage":"Could not tag and disambiguate '<token>'","messagePattern":"Could not tag and disambiguate '<token>'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"languagetool-language-modules/ga/src/main/java/org/languagetool/rules/ga/NoDisambiguationIrishPartialPosTagFilter.java","lineNumber":47,"sourceCode":"import java.util.List;\n\n/**\n * A {@link PartialPosTagFilter} for Irish that does not run the disambiguator.\n * @since 3.2\n * @see IrishPartialPosTagFilter\n */\npublic class NoDisambiguationIrishPartialPosTagFilter extends PartialPosTagFilter {\n\n  private final Tagger tagger = Irish.getInstance().getTagger();\n\n  @Override\n  protected List<AnalyzedTokenReadings> tag(String token) {\n    try {\n      List<AnalyzedTokenReadings> tags = tagger.tag(Collections.singletonList(token));\n      AnalyzedTokenReadings[] atr = tags.toArray(new AnalyzedTokenReadings[tags.size()]);\n      return Arrays.asList(atr);\n    } catch (IOException e) {\n      throw new RuntimeException(\"Could not tag and disambiguate '\" + token + \"'\", e);\n    }\n  }\n}\n","sourceCodeStart":29,"sourceCodeEnd":51,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-language-modules/ga/src/main/java/org/languagetool/rules/ga/NoDisambiguationIrishPartialPosTagFilter.java#L29-L51","documentation":"NoDisambiguationIrishPartialPosTagFilter.tag calls the Irish tagger without disambiguation and rethrows any IOException as this RuntimeException identifying the token. Despite the message wording, no disambiguation step runs here — the failure is purely in tagging (dictionary/resource I/O).","triggerScenarios":"tagger.tag(Collections.singletonList(token)) throws IOException — missing or unreadable Irish tagger dictionary resources on the classpath while a POS filter processes a token.","commonSituations":"Incomplete or custom LanguageTool deployments lacking ga resources; classloader issues in embedded/plugin environments; corrupted resource files after partial upgrades.","solutions":["Inspect the wrapped IOException cause to find the unreadable/missing resource and restore it.","Verify the Irish language module (dictionaries) is fully present on the classpath.","Fix filesystem permissions on the LanguageTool resource directory.","Consider caching the tagger instance and pre-warming resource loading at startup to surface resource problems early."],"exampleFix":"// before\ntry { return tagger.tag(...); } catch (IOException e) { throw new RuntimeException(\"Could not tag...\", e); }\n// after (fail fast at init)\n@FunctionalInterface interface SafeTag { List<AnalyzedTokenReadings> apply(String t); }\n// validate resources once in constructor: tagger.tag(List.of(\"tá\")) before accepting traffic","handlingStrategy":"try-catch","validationCode":"List<AnalyzedTokenReadings> probe = tagger.tag(List.of(\"tá\"));\nif (probe == null || probe.isEmpty()) throw new IllegalStateException(\"Irish tagger not operational\");","typeGuard":null,"tryCatchPattern":"try { return tag(token); } catch (RuntimeException e) { log.error(\"Tagging failed for '\" + token + \"'\", e.getCause()); return Collections.emptyList(); }","preventionTips":["Pre-warm the tagger at startup to surface missing resources early","Keep the full Irish language module on the classpath","Fix message wording confusion: this filter never runs disambiguation"],"tags":["java","languagetool","pos-tagging","io","irish"],"backgroundTag":"file-read-failed","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}