stanfordnlp/CoreNLP · error · IllegalArgumentException

We don't support disambiguating pronoun

Error message

We don't support disambiguating pronoun '${pronoun}'

What it means

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.

Solutions

  1. Only call disambiguatePersonalPronoun for pronouns in the ambiguousPersonalPronouns set (check via strippedVerb.getPronouns() first).
  2. Normalize the pronoun string (trim, lowercase, strip diacritics) before the call.
  3. Handle non-ambiguous clitics with their deterministic grammatical function instead of the disambiguator.
  4. If extending the library, add the pronoun to ambiguousPersonalPronouns and implement its disambiguation branch.

Example fix

// before
disambiguator.disambiguatePersonalPronoun(strippedVerb, 0, clauseYield); // throws for 'me'
// after
String p = strippedVerb.getPronouns().get(0).toLowerCase().trim();
if (AnCoraPronounDisambiguator.isAmbiguous(p)) {
  type = AnCoraPronounDisambiguator.disambiguatePersonalPronoun(strippedVerb, 0, clauseYield);
} else {
  type = deterministicFunctionFor(p); // e.g. 'me' -> DATIVE/ACCUSATIVE by context
}
Defensive patterns

Strategy: validation

Validate before calling

String p = strippedVerb.getPronouns().get(pronounIdx).toLowerCase().trim();
boolean ok = AnCoraPronounDisambiguator.isAmbiguous(p);
if (!ok) { /* route to deterministic clitic handling instead */ }

Type guard

function isDisambiguatable(pronouns, idx) {
  if (idx < 0 || idx >= pronouns.size()) return false;
  return ambiguousPersonalPronouns.contains(pronouns.get(idx).toLowerCase().trim());
}

Try / catch

try {
  type = AnCoraPronounDisambiguator.disambiguatePersonalPronoun(strippedVerb, idx, clauseYield);
} catch (IllegalArgumentException e) {
  if (e.getMessage().startsWith("We don't support disambiguating pronoun")) {
    type = defaultCliticType(pronouns.get(idx));
  } else { throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/77a0e73558300509. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/international/spanish/process/AnCoraPronounDisambiguator.java:362

   *
   * i.e., those in which the meaning is actually ambiguous.
   *
   * @param strippedVerb Stripped verb as returned by
   *                     {@link edu.stanford.nlp.international.spanish.SpanishVerbStripper#separatePronouns(String)}.
   * @param pronounIdx The index of the pronoun within
   *                   {@code strippedVerb.getPronouns()} which should be
   *                   disambiguated.
   * @param clauseYield A string representing the yield of the
   *                    clause which contains the given verb
   * @throws java.lang.IllegalArgumentException If the given pronoun is
   *         not ambiguous, or its disambiguation is not supported.
   */
  public static PersonalPronounType disambiguatePersonalPronoun(SpanishVerbStripper.StrippedVerb strippedVerb,
                                                                int pronounIdx, String clauseYield) {
    List<String> pronouns = strippedVerb.getPronouns();
    String pronoun = pronouns.get(pronounIdx).toLowerCase();
    if (!ambiguousPersonalPronouns.contains(pronoun))
      throw new IllegalArgumentException("We don't support disambiguating pronoun '" + pronoun + "'");

    if (pronouns.size() == 1 && pronoun.equalsIgnoreCase("se"))
      return PersonalPronounType.REFLEXIVE;

    String verb = strippedVerb.getStem();
    if (alwaysReflexiveVerbs.contains(verb))
      return PersonalPronounType.REFLEXIVE;
    else if (neverReflexiveVerbs.contains(verb))
      return PersonalPronounType.OBJECT;

    Pair<String, String> bruteForceKey = new Pair<>(verb, clauseYield);
    if (bruteForceDecisions.containsKey(bruteForceKey))
      return bruteForceDecisions.get(bruteForceKey);

    // Log this instance where a clitic pronoun could not be disambiguated.
    log.info("Failed to disambiguate: " + verb
             + "\nContaining clause:\t" + clauseYield + "\n");

View on GitHub (pinned to 1b7edd19c4)