{"record":{"id":"5683fe388acfa9bf","repo":"stanfordnlp/CoreNLP","slug":"coreference-is-not-implemented-for-german","errorCode":null,"errorMessage":"Coreference is not implemented for German","messagePattern":"Coreference is not implemented for German","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/simple/GermanDocument.java","lineNumber":89,"sourceCode":"   * No lemma annotator for German -- 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 German\");\n  }\n\n\n  @Override\n  public Map<Integer, CorefChain> coref(Properties props) {\n    throw new IllegalArgumentException(\"Coreference is not implemented for German\");\n  }\n\n}\n","sourceCodeStart":71,"sourceCodeEnd":93,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/simple/GermanDocument.java#L71-L93","documentation":"GermanDocument.coref() throws IllegalArgumentException because coreference resolution is not implemented for German in Stanford CoreNLP's simple API. Any attempt to compute coref chains on a German document fails immediately with this message. It is an intentional unsupported-operation stub.","triggerScenarios":"Calling Document.coref(Properties) or Sentence.coref() on a German document, or including the 'coref' annotator in a German StanfordCoreNLP pipeline.","commonSituations":"Reusing an English coref pipeline config for German; assuming annotator support is uniform across the -language flag values.","solutions":["Exclude the 'coref' annotator from German pipelines","Run coreference only on supported languages (English)","Integrate a third-party German coreference system","Guard with instanceof/language checks before calling coref()"],"exampleFix":"// before\npipeline = new StanfordCoreNLP(propsWithCoref, \"de\");\nMap<Integer, CorefChain> c = new Document(text).coref();\n// after\nif (!\"en\".equals(lang)) {\n  Map<Integer, CorefChain> c = Collections.emptyMap(); // coref unsupported\n} else {\n  Map<Integer, CorefChain> c = new Document(text).coref();\n}","handlingStrategy":"validation","validationCode":"if (doc instanceof GermanDocument) {\n  throw new UnsupportedOperationException(\"coref not supported for German\");\n}","typeGuard":"boolean supportsCoref(Document d) {\n  return !(d instanceof GermanDocument);\n}","tryCatchPattern":"try {\n  Map<Integer, CorefChain> chains = doc.coref(props);\n} catch (IllegalArgumentException e) {\n  chains = Collections.emptyMap();\n}","preventionTips":["Filter annotators by language support before pipeline creation","Unit-test pipelines per language to catch unsupported annotators early","Log and skip unsupported annotators instead of failing the batch"],"tags":["corenlp","coreference","unsupported-language"],"backgroundTag":"method-not-implemented","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}