{"record":{"id":"9d70943ab951dbdd","repo":"languagetool-org/languagetool","slug":"in-order-to-use-frequency-data-add-the-line-fsa-d","errorCode":null,"errorMessage":"In order to use frequency data add the line 'fsa.dict.frequency-included=true' to the dictionary info file.","messagePattern":"In order to use frequency data add the line 'fsa\\.dict\\.frequency-included=true' to the dictionary info file\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"languagetool-tools/src/main/java/org/languagetool/tools/DictionaryBuilder.java","lineNumber":147,"sourceCode":"      FileInputStream fis = new FileInputStream(freqListFile.getAbsoluteFile());\n      InputStreamReader reader = new InputStreamReader(fis, StandardCharsets.UTF_8);\n      BufferedReader br = new BufferedReader(reader)\n    ) {\n      String line;\n      while ((line = br.readLine()) != null) {\n        Matcher m = pFreqEntry.matcher(line);\n        if (m.matches()) {\n          freqList.put(m.group(3), Integer.parseInt(m.group(1)));\n        }\n      }\n    } catch (IOException e) {\n      throw new RuntimeException(\"Cannot read file: \" + freqListFile.getAbsolutePath());\n    }\n  }\n  \n  protected File addFreqData(File dictFile, boolean useSeparator) throws IOException {\n    if (!isOptionTrue(\"fsa.dict.frequency-included\")) {\n      throw new IOException(\"In order to use frequency data add the line 'fsa.dict.frequency-included=true' to the dictionary info file.\");\n    }\n    String separator = getOption(\"fsa.dict.separator\");\n    if (separator == null || separator.trim().isEmpty()) {\n      throw new IOException(\"A separator character (fsa.dict.separator) must be defined in the dictionary info file.\");\n    }\n    File tempFile = File.createTempFile(DictionaryBuilder.class.getSimpleName(), \"WithFrequencies.txt\");\n    tempFile.deleteOnExit();\n    String encoding = getOption(\"fsa.dict.encoding\");\n    int freqValuesApplied = 0;\n\n    try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile.getAbsoluteFile()), encoding));\n         BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(dictFile.getAbsoluteFile()), encoding))) {\n      String line;\n      int maxFreq = Collections.max(freqList.values());\n      double maxFreqLog = Math.log(maxFreq);\n      while ((line = br.readLine()) != null) {\n        Matcher m = pTaggerEntry.matcher(line);\n        if (m.matches()) {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-tools/src/main/java/org/languagetool/tools/DictionaryBuilder.java#L129-L165","documentation":"Configuration guard in DictionaryBuilder.addFreqData: frequency data was provided but the dictionary .info file lacks the 'fsa.dict.frequency-included=true' property, so embedding frequencies into the FSA is refused.","triggerScenarios":"Thrown at languagetool-tools/src/main/java/org/languagetool/tools/DictionaryBuilder.java:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add fsa.dict.frequency-included=true to the dictionary .info file","Or drop the frequency list input if frequencies are not wanted"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}