languagetool-org/languagetool · error · IllegalArgumentException

Please specify an .info file for a synthesizer as the second

Error message

Please specify an .info file for a synthesizer as the second parameter, named '<xyz>_synth.info', with <xyz> being a language'

What it means

Naming guard in SynthDictionaryBuilder.getPosTagIgnoreRegex: the .info file name contains no underscore, so it does not follow the required '<xyz>_synth.info' convention and the language code cannot be extracted.

Source

Thrown at languagetool-tools/src/main/java/org/languagetool/tools/SynthDictionaryBuilder.java:106

          String line = scanner.nextLine();
          if (!line.startsWith("#")) {
            result.add(line);
          }
        }
      }
      System.out.println("Loaded " + result.size() + " words to be ignored from " + file);
    } else {
      System.out.println("File " + file.getAbsolutePath() + " does not exist, no items will be ignored");
    }
    return result;
  }

  @Nullable
  private Pattern getPosTagIgnoreRegex(File infoFile) {
    String fileName = infoFile.getName();
    int underscorePos = fileName.indexOf('_');
    if (underscorePos == -1) {
      throw new IllegalArgumentException("Please specify an .info file for a synthesizer as the second parameter, named '<xyz>_synth.info', with <xyz> being a language'");
    }
    String baseName = fileName.substring(0, underscorePos);
    if (baseName.equals("polish")) {
      return Pattern.compile(POLISH_IGNORE_REGEX);
    }
    return null;
  }

  private File reverseLineContent(File plainTextDictFile, Set<String> itemsToBeIgnored, Pattern ignorePosRegex) throws IOException {
    File reversedFile = File.createTempFile(SynthDictionaryBuilder.class.getSimpleName() + "_reversed", ".txt");
    reversedFile.deleteOnExit();

    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.");
    }
    
    String encoding = getOption("fsa.dict.encoding");

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Rename the info file to '<lang>_synth.info', e.g. 'en_synth.info'
  2. Pass the correct synthesizer info file as the second parameter
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at languagetool-tools/src/main/java/org/languagetool/tools/SynthDictionaryBuilder.java:106 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/73ffb5291f5a4458. Report an issue: GitHub.