{"record":{"id":"ff3a675d9e6bbf78","repo":"languagetool-org/languagetool","slug":"words-can-t-start-with-suffix-marker","errorCode":null,"errorMessage":"Words can't start with \" + SUFFIX_MARKER","messagePattern":"Words can't start with \" \\+ SUFFIX_MARKER","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"languagetool-core/src/main/java/org/languagetool/synthesis/ManualSynthesizer.java","lineNumber":114,"sourceCode":"      }\n    });\n\n    possibleTags = Collections.unmodifiableSet(collectTags(mapping));\n  }\n\n  private static Int2ObjectOpenHashMap<List<Triple<String, String, String>>> groupByHash(Map<TaggedWord, List<String>> mapping) {\n    Int2ObjectOpenHashMap<List<Triple<String, String, String>>> byHash = new Int2ObjectOpenHashMap<>(mapping.size());\n    for (Map.Entry<TaggedWord, List<String>> entry : mapping.entrySet()) {\n      TaggedWord tw = entry.getKey();\n      String lemma = tw.getLemma();\n      int hash = hashCode(lemma, tw.getPosTag());\n      List<Triple<String, String, String>> list = byHash.get(hash);\n      if (list == null) {\n        byHash.put(hash, list = new ArrayList<>());\n      }\n      for (String word : entry.getValue()) {\n        if (word.startsWith(SUFFIX_MARKER)) {\n          throw new UnsupportedOperationException(\"Words can't start with \" + SUFFIX_MARKER);\n        }\n        String value = intern(encodeForm(lemma, word));\n        list.add(new ImmutableTriple<>(lemma, tw.getPosTag(), value));\n      }\n    }\n    return byHash;\n  }\n\n  private static String encodeForm(String lemma, String word) {\n    if (word.length() > lemma.length() && word.startsWith(lemma)) {\n      return SUFFIX_MARKER + word.substring(lemma.length());\n    }\n    if (word.length() >= lemma.length() && word.startsWith(lemma.substring(0, lemma.length() - 1))) {\n      return SUFFIX_MARKER + SUFFIX_MARKER + word.substring(lemma.length() - 1);\n    }\n    return word;\n  }\n","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-core/src/main/java/org/languagetool/synthesis/ManualSynthesizer.java#L96-L132","documentation":"Data-integrity guard while grouping the loaded mapping by hash: a lemma in the synthesizer data begins with the reserved SUFFIX_MARKER character, which the encoding uses internally to distinguish suffixed forms and therefore can never appear at the start of a word. The faulty input is the offending lemma string in the synthesizer data file.","triggerScenarios":"Thrown at languagetool-core/src/main/java/org/languagetool/synthesis/ManualSynthesizer.java:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or escape the leading SUFFIX_MARKER character in the offending lemma entry of the data file","Fix the data-generation step that produced a lemma starting with the reserved marker"],"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"}