{"record":{"id":"79f6b33ab5d03a64","repo":"languagetool-org/languagetool","slug":"could-not-load-dictionary","errorCode":null,"errorMessage":"Could not load dictionary","messagePattern":"Could not load dictionary","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-core/src/main/java/org/languagetool/synthesis/BaseSynthesizer.java","lineNumber":158,"sourceCode":"        dict = this.dictionary;\n        if (dict == null) {\n          dictionary = dict = MorfologikSpeller.getDictionaryWithCaching(resourceFileName);\n        }\n      }\n    }\n    return dict;\n  }\n\n  /**\n   * Creates a new {@link IStemmer} based on the configured {@link #getDictionary() dictionary}.\n   * The result must not be shared among threads.\n   * @since 2.3\n   */\n  protected IStemmer createStemmer() {\n    try {\n      return new DictionaryLookup(getDictionary());\n    } catch (IOException e) {\n      throw new RuntimeException(\"Could not load dictionary\", e);\n    }\n  }\n  \n  private Soros createNumberSpeller(String langcode) {\n    Soros s;\n    try {\n      URL url = JLanguageTool.getDataBroker().getFromResourceDirAsUrl(sorosFileName);\n      BufferedReader f = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8));\n      StringBuilder sb = new StringBuilder();\n      String line;\n      while ((line = f.readLine()) != null) {\n        sb.append(line);\n        sb.append('\\n');\n      }\n      s = new Soros(new String(sb), langcode);\n    } catch (Exception e) {\n      return null;\n    }","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-core/src/main/java/org/languagetool/synthesis/BaseSynthesizer.java#L140-L176","documentation":"Wrapper exception in BaseSynthesizer.createStemmer: opening the Morfologik dictionary for the synthesizer failed with an IOException (missing, corrupt, or unreadable dictionary resource), which is rethrown as a RuntimeException. The chained cause carries the underlying I/O problem; the resource at fault is the synthesizer's dictionary file.","triggerScenarios":"Thrown at languagetool-core/src/main/java/org/languagetool/synthesis/BaseSynthesizer.java:158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the chained IOException cause for the real reason (file missing, wrong path, corrupt data)","Verify the synthesizer's dictionary resource exists and is bundled with the language module"],"exampleFix":null,"handlingStrategy":"try-catch","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"}