{"record":{"id":"a8e9b86ee163ffbb","repo":"stanfordnlp/CoreNLP","slug":"coreference-is-not-implemented-for-arabic","errorCode":null,"errorMessage":"Coreference is not implemented for Arabic","messagePattern":"Coreference is not implemented for Arabic","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/simple/ArabicDocument.java","lineNumber":100,"sourceCode":"  protected Document runSentiment(Properties props) {\n    throw new IllegalArgumentException(\"Sentiment analysis is not implemented for Arabic\");\n  }\n\n\n  @Override\n  protected Document runDepparse(Properties props) {\n    throw new IllegalArgumentException(\"Dependency parsing is not implemented for Arabic\");\n  }\n\n  @Override\n  protected Document runNER(Properties props) {\n    throw new IllegalArgumentException(\"NER is not implemented for Arabic\");\n  }\n\n\n  @Override\n  public Map<Integer, CorefChain> coref(Properties props) {\n    throw new IllegalArgumentException(\"Coreference is not implemented for Arabic\");\n  }\n\n}\n","sourceCodeStart":82,"sourceCodeEnd":104,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/simple/ArabicDocument.java#L82-L104","documentation":"ArabicDocument.coref() throws IllegalArgumentException because coreference resolution is not implemented for Arabic in the stanford.nlp.simple API. The public coref(Properties) override is a stub that always fails for Arabic documents.","triggerScenarios":"Calling coref() on an ArabicDocument, or running a Document operation chain that requires coreference on Arabic text.","commonSituations":"Multilingual pipelines running the full Stanford CoreNLP annotator set (including dcoref/coref) uniformly over documents of all languages.","solutions":["Skip coref for ArabicDocument instances (instanceof check before calling).","Run coreference only on supported-language documents (e.g. English).","Use an external Arabic coreference system instead of the CoreNLP simple API."],"exampleFix":"// before\nMap<Integer, CorefChain> chains = doc.coref();\n// after\nif (!(doc instanceof ArabicDocument)) {\n  Map<Integer, CorefChain> chains = doc.coref();\n}","handlingStrategy":"type-guard","validationCode":"if (doc instanceof edu.stanford.nlp.simple.ArabicDocument) skipCoref = true;","typeGuard":"boolean supportsCoref(Document doc) { return !(doc instanceof edu.stanford.nlp.simple.ArabicDocument); }","tryCatchPattern":"try {\n  doc.coref();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not implemented\")) {\n    log.warn(\"Coreference unavailable for this language, skipping\");\n  } else throw e;\n}","preventionTips":["Run coreference only for supported languages.","Document unsupported language operations in pipeline config.","Consider external coreference systems for Arabic."],"tags":["nlp","unsupported-language","coreference","arabic"],"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-15T23:17:13.987Z"}