{"record":{"id":"034944b681a3052a","repo":"languagetool-org/languagetool","slug":"problems-with-loading-disambiguation-file-dis","errorCode":null,"errorMessage":"Problems with loading disambiguation file: \" + disambiguationFile","messagePattern":"Problems with loading disambiguation file: \" \\+ disambiguationFile","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-core/src/main/java/org/languagetool/tagging/disambiguation/rules/XmlRuleDisambiguator.java","lineNumber":60,"sourceCode":"\n  private static final String DISAMBIGUATION_FILE = \"disambiguation.xml\";\n  private static final String GLOBAL_DISAMBIGUATION_FILE = \"disambiguation-global.xml\";\n\n  private final RuleSet disambiguationRules;\n  \n  public XmlRuleDisambiguator(Language language) {\n    // by default, don't use global disambiguation (for now)\n    this(language, false);\n  }\n\n  public XmlRuleDisambiguator(Language language, boolean useGlobalDisambiguation) {\n    Objects.requireNonNull(language);\n    String disambiguationFile = language.getShortCode() + \"/\" + DISAMBIGUATION_FILE;\n    List<DisambiguationPatternRule> disambiguationRulesList;\n    try {\n      disambiguationRulesList = loadPatternRules(disambiguationFile, language);\n    } catch (Exception e) {\n      throw new RuntimeException(\"Problems with loading disambiguation file: \" + disambiguationFile, e);\n    }\n    if (useGlobalDisambiguation) {\n      // disambiguation-global.xml\n      try {\n        disambiguationRulesList.addAll(loadPatternRules(GLOBAL_DISAMBIGUATION_FILE, language));\n      } catch (Exception e) {\n        throw new RuntimeException(\"Problems with loading global disambiguation file: \" + GLOBAL_DISAMBIGUATION_FILE, e);\n      }\n    }\n    disambiguationRules = RuleSet.textHinted(disambiguationRulesList);\n  }\n\n  @Override\n  public AnalyzedSentence disambiguate(AnalyzedSentence input) throws IOException {\n    return disambiguate(input, null);\n  }\n\n  @Override","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-core/src/main/java/org/languagetool/tagging/disambiguation/rules/XmlRuleDisambiguator.java#L42-L78","documentation":"Wraps any exception raised while loading and parsing the language's disambiguation.xml into DisambiguationPatternRules during XmlRuleDisambiguator construction. It signals the disambiguation rule set is unavailable — missing resource, SAX parse error, or invalid rule semantics — so the language's disambiguator cannot be created.","triggerScenarios":"Thrown at languagetool-core/src/main/java/org/languagetool/tagging/disambiguation/rules/XmlRuleDisambiguator.java:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped cause for the specific XML parse or rule error and its line number","Ensure <shortCode>/disambiguation.xml exists in the language resource directory and is valid UTF-8 XML","Validate the XML against the disambiguation rules schema before shipping"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}