{"record":{"id":"b13cfbb430afd06d","repo":"stanfordnlp/CoreNLP","slug":"coreference-is-not-implemented-for-spanish","errorCode":null,"errorMessage":"Coreference is not implemented for Spanish","messagePattern":"Coreference is not implemented for Spanish","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/simple/SpanishDocument.java","lineNumber":95,"sourceCode":"    return mockLemma(props);\n  }\n\n\n  @Override\n  protected Document runSentiment(Properties props) {\n    throw new IllegalArgumentException(\"Sentiment analysis is not implemented for Spanish\");\n  }\n\n\n  @Override\n  protected Document runDepparse(Properties props) {\n    throw new IllegalArgumentException(\"Dependency parsing is not implemented for Spanish\");\n  }\n\n\n  @Override\n  public Map<Integer, CorefChain> coref(Properties props) {\n    throw new IllegalArgumentException(\"Coreference is not implemented for Spanish\");\n  }\n\n}\n","sourceCodeStart":77,"sourceCodeEnd":99,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/simple/SpanishDocument.java#L77-L99","documentation":"SpanishDocument.coref is an explicit stub: coreference resolution is not implemented for the Spanish simple-API pipeline, so it throws IllegalArgumentException. This signals the unsupported feature at call time instead of silently returning empty results.","triggerScenarios":"Calling coref(props) or document.coref() on a SpanishDocument instance.","commonSituations":"Pipeline code that runs coreference on every document regardless of language; porting English coref workflows to Spanish; downstream components (e.g. entity linking) that depend on CorefChain output.","solutions":["Skip coreference resolution for Spanish documents","Use a tool with Spanish coreference support (e.g. cross-lingual coref libraries) outside the simple API","Guard the call with a language capability check","Handle the IllegalArgumentException explicitly to degrade gracefully"],"exampleFix":"// before\nDocument d = new SpanishDocument(text);\nMap<Integer, CorefChain> chains = d.coref(); // throws\n// after\nif (!(d instanceof SpanishDocument)) {\n  Map<Integer, CorefChain> chains = d.coref();\n}","handlingStrategy":"fallback","validationCode":"if (doc instanceof SpanishDocument) { /* skip coref */ }","typeGuard":"boolean supportsCoref(Document d) { return !(d instanceof SpanishDocument); }","tryCatchPattern":"try {\n  Map<Integer, CorefChain> chains = doc.coref();\n} catch (IllegalArgumentException e) {\n  chains = Collections.emptyMap();\n}","preventionTips":["Treat coref as language-dependent and guard calls","Avoid building features that require coref for Spanish text","Return empty/absent coref results gracefully in shared pipeline code"],"tags":["java","nlp","spanish","unsupported-feature","coreference"],"backgroundTag":"operation-not-supported","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"}