{"record":{"id":"77a0e73558300509","repo":"stanfordnlp/CoreNLP","slug":"we-don-t-support-disambiguating-pronoun-pronoun","errorCode":null,"errorMessage":"We don't support disambiguating pronoun '${pronoun}'","messagePattern":"We don't support disambiguating pronoun '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/international/spanish/process/AnCoraPronounDisambiguator.java","lineNumber":362,"sourceCode":"   *\n   * i.e., those in which the meaning is actually ambiguous.\n   *\n   * @param strippedVerb Stripped verb as returned by\n   *                     {@link edu.stanford.nlp.international.spanish.SpanishVerbStripper#separatePronouns(String)}.\n   * @param pronounIdx The index of the pronoun within\n   *                   {@code strippedVerb.getPronouns()} which should be\n   *                   disambiguated.\n   * @param clauseYield A string representing the yield of the\n   *                    clause which contains the given verb\n   * @throws java.lang.IllegalArgumentException If the given pronoun is\n   *         not ambiguous, or its disambiguation is not supported.\n   */\n  public static PersonalPronounType disambiguatePersonalPronoun(SpanishVerbStripper.StrippedVerb strippedVerb,\n                                                                int pronounIdx, String clauseYield) {\n    List<String> pronouns = strippedVerb.getPronouns();\n    String pronoun = pronouns.get(pronounIdx).toLowerCase();\n    if (!ambiguousPersonalPronouns.contains(pronoun))\n      throw new IllegalArgumentException(\"We don't support disambiguating pronoun '\" + pronoun + \"'\");\n\n    if (pronouns.size() == 1 && pronoun.equalsIgnoreCase(\"se\"))\n      return PersonalPronounType.REFLEXIVE;\n\n    String verb = strippedVerb.getStem();\n    if (alwaysReflexiveVerbs.contains(verb))\n      return PersonalPronounType.REFLEXIVE;\n    else if (neverReflexiveVerbs.contains(verb))\n      return PersonalPronounType.OBJECT;\n\n    Pair<String, String> bruteForceKey = new Pair<>(verb, clauseYield);\n    if (bruteForceDecisions.containsKey(bruteForceKey))\n      return bruteForceDecisions.get(bruteForceKey);\n\n    // Log this instance where a clitic pronoun could not be disambiguated.\n    log.info(\"Failed to disambiguate: \" + verb\n             + \"\\nContaining clause:\\t\" + clauseYield + \"\\n\");\n","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/spanish/process/AnCoraPronounDisambiguator.java#L344-L380","documentation":"disambiguatePersonalPronoun classifies clitic pronouns attached to a Spanish verb (e.g. reflexive vs. dative readings of 'se'). Only a fixed whitelist of genuinely ambiguous pronouns is supported; calling it with a pronoun outside ambiguousPersonalPronouns throws this IllegalArgumentException because no disambiguation rules exist for it.","triggerScenarios":"Calling disambiguatePersonalPronoun(strippedVerb, pronounIdx, clauseYield) where pronouns.get(pronounIdx) is a clitic not in ambiguousPersonalPronouns (e.g. 'me', 'te', 'lo' supplied directly, or casing/whitespace variants since input is only lowercased, not trimmed), or pronounIdx indexing a non-ambiguous pronoun in a multi-pronoun cluster.","commonSituations":"Custom AnCora conversion pipelines feeding raw verb tokens that SpanishVerbStripper extracted but that are not ambiguous; locale/formatting differences leaving accents like 'sé' instead of 'se'; code changes that reorder the pronoun list so pronounIdx points at the wrong clitic.","solutions":["Only call disambiguatePersonalPronoun for pronouns in the ambiguousPersonalPronouns set (check via strippedVerb.getPronouns() first).","Normalize the pronoun string (trim, lowercase, strip diacritics) before the call.","Handle non-ambiguous clitics with their deterministic grammatical function instead of the disambiguator.","If extending the library, add the pronoun to ambiguousPersonalPronouns and implement its disambiguation branch."],"exampleFix":"// before\ndisambiguator.disambiguatePersonalPronoun(strippedVerb, 0, clauseYield); // throws for 'me'\n// after\nString p = strippedVerb.getPronouns().get(0).toLowerCase().trim();\nif (AnCoraPronounDisambiguator.isAmbiguous(p)) {\n  type = AnCoraPronounDisambiguator.disambiguatePersonalPronoun(strippedVerb, 0, clauseYield);\n} else {\n  type = deterministicFunctionFor(p); // e.g. 'me' -> DATIVE/ACCUSATIVE by context\n}","handlingStrategy":"validation","validationCode":"String p = strippedVerb.getPronouns().get(pronounIdx).toLowerCase().trim();\nboolean ok = AnCoraPronounDisambiguator.isAmbiguous(p);\nif (!ok) { /* route to deterministic clitic handling instead */ }","typeGuard":"function isDisambiguatable(pronouns, idx) {\n  if (idx < 0 || idx >= pronouns.size()) return false;\n  return ambiguousPersonalPronouns.contains(pronouns.get(idx).toLowerCase().trim());\n}","tryCatchPattern":"try {\n  type = AnCoraPronounDisambiguator.disambiguatePersonalPronoun(strippedVerb, idx, clauseYield);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"We don't support disambiguating pronoun\")) {\n    type = defaultCliticType(pronouns.get(idx));\n  } else { throw e; }\n}","preventionTips":["Check membership in ambiguousPersonalPronouns before calling.","Normalize pronoun strings (trim, lowercase, strip diacritics) upstream.","Verify pronounIdx still matches the intended pronoun after any list manipulation."],"tags":["java","stanford-nlp","spanish","nlp","unsupported-input"],"backgroundTag":"unsupported-operation","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}