{"record":{"id":"bbf4bee670b715b5","repo":"stanfordnlp/CoreNLP","slug":"dependency-parsing-is-not-implemented-for-spanish","errorCode":null,"errorMessage":"Dependency parsing is not implemented for Spanish","messagePattern":"Dependency parsing is not implemented for Spanish","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/simple/SpanishDocument.java","lineNumber":89,"sourceCode":"   * No lemma annotator for Spanish -- set the lemma to be the word.\n   *\n   * @see Document#runLemma(Properties)\n   */\n  @Override\n  protected Document runLemma(Properties props) {\n    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":71,"sourceCodeEnd":99,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/simple/SpanishDocument.java#L71-L99","documentation":"SpanishDocument.runDepparse is an explicit stub: dependency parsing is not implemented for the Spanish simple-API pipeline, so the method throws IllegalArgumentException. Any dependency-parse request on a Spanish document reaches this unsupported-operation guard.","triggerScenarios":"Calling depparse(), runDepparse(props), or APIs that internally request the depparse annotator on a SpanishDocument.","commonSituations":"Language-agnostic analysis code that assumes all Document types support dependency parsing; migrating English pipelines to Spanish; requesting grammatical structure on Spanish text through the simple API.","solutions":["Skip dependency parsing for Spanish documents","Use a pipeline/tool with Spanish dependency parsing support (e.g. full CoreNLP Spanish models via StanfordCoreNLP, or udpipe/SpaCy)","Guard calls behind a language/capability check","Extend SpanishDocument and override runDepparse with a working annotator pipeline if needed"],"exampleFix":"// before\nDocument d = new SpanishDocument(text);\nd.depparse(); // throws\n// after\nif (!(d instanceof SpanishDocument)) {\n  d.depparse();\n}","handlingStrategy":"fallback","validationCode":"if (doc instanceof SpanishDocument) { /* skip depparse */ }","typeGuard":"boolean supportsDepparse(Document d) { return !(d instanceof SpanishDocument); }","tryCatchPattern":"try {\n  doc.depparse();\n} catch (IllegalArgumentException e) {\n  // use alternative parser or skip\n}","preventionTips":["Check language support before invoking dependency parsing","Route Spanish text to a parser that supports it (e.g. full CoreNLP Spanish models)","Design pipelines with optional annotator stages"],"tags":["java","nlp","spanish","unsupported-feature","depparse"],"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"}