languagetool-org/languagetool · error · IOException

In order to use frequency data add the line 'fsa.dict.freque

Error message

In order to use frequency data add the line 'fsa.dict.frequency-included=true' to the dictionary info file.

What it means

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.

Source

Thrown at languagetool-tools/src/main/java/org/languagetool/tools/DictionaryBuilder.java:147

      FileInputStream fis = new FileInputStream(freqListFile.getAbsoluteFile());
      InputStreamReader reader = new InputStreamReader(fis, StandardCharsets.UTF_8);
      BufferedReader br = new BufferedReader(reader)
    ) {
      String line;
      while ((line = br.readLine()) != null) {
        Matcher m = pFreqEntry.matcher(line);
        if (m.matches()) {
          freqList.put(m.group(3), Integer.parseInt(m.group(1)));
        }
      }
    } catch (IOException e) {
      throw new RuntimeException("Cannot read file: " + freqListFile.getAbsolutePath());
    }
  }
  
  protected File addFreqData(File dictFile, boolean useSeparator) throws IOException {
    if (!isOptionTrue("fsa.dict.frequency-included")) {
      throw new IOException("In order to use frequency data add the line 'fsa.dict.frequency-included=true' to the dictionary info file.");
    }
    String separator = getOption("fsa.dict.separator");
    if (separator == null || separator.trim().isEmpty()) {
      throw new IOException("A separator character (fsa.dict.separator) must be defined in the dictionary info file.");
    }
    File tempFile = File.createTempFile(DictionaryBuilder.class.getSimpleName(), "WithFrequencies.txt");
    tempFile.deleteOnExit();
    String encoding = getOption("fsa.dict.encoding");
    int freqValuesApplied = 0;

    try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile.getAbsoluteFile()), encoding));
         BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(dictFile.getAbsoluteFile()), encoding))) {
      String line;
      int maxFreq = Collections.max(freqList.values());
      double maxFreqLog = Math.log(maxFreq);
      while ((line = br.readLine()) != null) {
        Matcher m = pTaggerEntry.matcher(line);
        if (m.matches()) {

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Add fsa.dict.frequency-included=true to the dictionary .info file
  2. Or drop the frequency list input if frequencies are not wanted
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at languagetool-tools/src/main/java/org/languagetool/tools/DictionaryBuilder.java:147 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06). Data as JSON: /api/errors/9d70943ab951dbdd. Report an issue: GitHub.