{"record":{"id":"7c584a165e0dcd00","repo":"languagetool-org/languagetool","slug":"could-not-tag-and-disambiguate-token-7c584a","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/IrishPartialPosTagFilter.java","lineNumber":52,"sourceCode":" * will apply that have a single {@code <match>} element.\n * <b>Warning: Do not use this in disambiguation.xml, it would cause an endless loop,\n * use {@link NoDisambiguationIrishPartialPosTagFilter} instead.</b> \n *\n * @since 2.8\n * @see NoDisambiguationIrishPartialPosTagFilter\n */\npublic class IrishPartialPosTagFilter extends PartialPosTagFilter {\n\n  @Override\n  protected List<AnalyzedTokenReadings> tag(String token) {\n    try {\n      var irishLanguage = Irish.getInstance();\n      List<AnalyzedTokenReadings> tags = irishLanguage.getTagger().tag(Collections.singletonList(token));\n      AnalyzedTokenReadings[] atr = tags.toArray(new AnalyzedTokenReadings[tags.size()]);\n      AnalyzedSentence disambiguated = irishLanguage.getDisambiguator().disambiguate(new AnalyzedSentence(atr));\n      return Arrays.asList(disambiguated.getTokens());\n    } catch (IOException e) {\n      throw new RuntimeException(\"Could not tag and disambiguate '\" + token + \"'\", e);\n    }\n  }\n}\n","sourceCodeStart":34,"sourceCodeEnd":56,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-language-modules/ga/src/main/java/org/languagetool/rules/ga/IrishPartialPosTagFilter.java#L34-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"Incomplete LanguageTool installation missing Irish dictionaries; fat-jar packaging that dropped resource files; read-permission problems on installed resources; running with a stripped classpath.","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."],"exampleFix":"// before (stripped jar)\njar without src/main/resources/org/languagetool/tagger/ga/*\n// after\ninclude all irish tagger/disambiguator resources in the build (maven-resources or shade config)","handlingStrategy":"try-catch","validationCode":"// verify resources once at startup\ntry (InputStream in = getClass().getResourceAsStream(\"/org/languagetool/tagger/ga/irish.dict\")) {\n  if (in == null) throw new IllegalStateException(\"Irish tagger resources missing from classpath\");\n}","typeGuard":null,"tryCatchPattern":"try { return filter.tag(token); } catch (RuntimeException e) { log.error(\"Tagging failed for '\" + token + \"'\", e.getCause()); return Collections.emptyList(); }","preventionTips":["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"],"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"}