{"record":{"id":"d506c7e3eb4f1c47","repo":"languagetool-org/languagetool","slug":"could-not-synthesize-infinitiveasantkn-wi","errorCode":null,"errorMessage":"Could not synthesize: \" + infinitiveAsAnTkn + \" with tag \" + analyzedToken.getPOSTag()","messagePattern":"Could not synthesize: \" \\+ infinitiveAsAnTkn \\+ \" with tag \" \\+ analyzedToken\\.getPOSTag\\(\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-language-modules/es/src/main/java/org/languagetool/rules/es/SimpleReplaceVerbsRule.java","lineNumber":185,"sourceCode":"        List<String> possibleReplacements = new ArrayList<>();\n        String[] synthesized = null;\n        List<String> replacementInfinitives = wrongWords.get(infinitive);\n        for (String replacementInfinitive : replacementInfinitives) {\n          if (replacementInfinitive.startsWith(\"(\")) {\n            possibleReplacements.add(replacementInfinitive);\n          } else {\n            String[] parts = replacementInfinitive.split(\" \"); // the first part\n                                                               // is the verb\n            AnalyzedToken infinitiveAsAnTkn = new AnalyzedToken(parts[0], \"V.*\", parts[0]);\n            for (AnalyzedToken analyzedToken : analyzedTokenReadings) {\n              try {\n                String POSTag = analyzedToken.getPOSTag();\n                if (infinitiveAsAnTkn.getLemma().equals(\"haver\")) {\n                  POSTag = \"VA\" + POSTag.substring(2);\n                }\n                synthesized = synth.synthesize(infinitiveAsAnTkn, POSTag);\n              } catch (IOException e) {\n                throw new RuntimeException(\n                    \"Could not synthesize: \" + infinitiveAsAnTkn + \" with tag \" + analyzedToken.getPOSTag(), e);\n              }\n              for (String s : synthesized) {\n                for (int j = 1; j < parts.length; j++) {\n                  s = s.concat(\" \").concat(parts[j]);\n                }\n                if (!possibleReplacements.contains(s)) {\n                  possibleReplacements.add(s);\n                }\n              }\n            }\n          }\n        }\n        if (possibleReplacements.size() > 0) {\n          RuleMatch potentialRuleMatch = createRuleMatch(tokenReadings, possibleReplacements, sentence, infinitive);\n          ruleMatches.add(potentialRuleMatch);\n        }\n      }","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-language-modules/es/src/main/java/org/languagetool/rules/es/SimpleReplaceVerbsRule.java#L167-L203","documentation":"SimpleReplaceVerbsRule.match tries to synthesize the infinitive replacement form of a Spanish verb via the synthesizer, rewriting 'haver' tags to auxiliary 'VA...' form. If synthesize throws IOException (no forms found for token+tag in the dictionary), it wraps it in a RuntimeException naming the infinitive and POSTag.","triggerScenarios":"A Spanish verb-replacement rule produces an infinitive whose lemma is absent from the dictionary or whose POSTag combination has no inflected forms; synthesize([], ...) throws and match rethrows with context.","commonSituations":"Dictionary/tagset updates breaking a rule's expected tag; rule data referencing a verb form missing from the Spanish POS dictionary; 'haver' tag rewriting producing an inconsistent tag string.","solutions":["Check the infinitive and tag in the message; verify both exist in the Spanish POS dictionary (image/spell .info + tagset).","Correct the rule data so the replacement infinitive and its tag match dictionary entries.","Rebuild/update the language dictionary if it is stale relative to the rule data."],"exampleFix":"// before (rule data refers to verb missing from dictionary)\nhaver\n// after (use dictionary-supported auxiliary)\nhaber","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  synthesized = synth.synthesize(infinitiveAsAnTkn, POSTag);\n} catch (IOException e) {\n  LOG.warn(\"No synthesis for '{}' tag '{}' — leaving original text unchanged\", infinitiveAsAnTkn, POSTag);\n  return super.match(...); // or skip replacement\n}","preventionTips":["Verify replacement infinitives exist in the POS dictionary before shipping rule data","Keep tagset knowledge in sync with dictionary updates","Add tests covering each verb replacement rule"],"tags":["java","languagetool","spanish","synthesizer","dictionary"],"backgroundTag":"unsupported-operation","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"}