{"record":{"id":"cee2cb6afa25b03f","repo":"stanfordnlp/CoreNLP","slug":"ner-is-not-implemented-for-arabic","errorCode":null,"errorMessage":"NER is not implemented for Arabic","messagePattern":"NER is not implemented for Arabic","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/simple/ArabicDocument.java","lineNumber":94,"sourceCode":"  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 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":76,"sourceCodeEnd":104,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/simple/ArabicDocument.java#L76-L104","documentation":"ArabicDocument.runNER() throws IllegalArgumentException because named entity recognition is not implemented for Arabic in the stanford.nlp.simple API. Calling Document.ner() on an Arabic document reaches this stub and fails deterministically.","triggerScenarios":"Calling ner() on an ArabicDocument, or any pipeline step that lists NER as a prerequisite on Arabic text.","commonSituations":"Multilingual annotation loops applying the standard English annotation set (POS, NER, etc.) to Arabic documents.","solutions":["Skip NER for ArabicDocument instances (instanceof check before calling).","Use a language whose NER model is bundled (English, etc.).","Use a third-party or custom-trained Arabic NER model via the full CoreNLP CRFClassifier pipeline."],"exampleFix":"// before\ndoc.ner();\n// after\nif (!(doc instanceof ArabicDocument)) {\n  doc.ner();\n}","handlingStrategy":"type-guard","validationCode":"if (doc instanceof edu.stanford.nlp.simple.ArabicDocument) skipNER = true;","typeGuard":"boolean supportsNER(Document doc) { return !(doc instanceof edu.stanford.nlp.simple.ArabicDocument); }","tryCatchPattern":"try {\n  doc.ner();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not implemented\")) {\n    log.warn(\"NER unavailable for this language, skipping\");\n  } else throw e;\n}","preventionTips":["Verify per-language NER model availability before adding NER to the pipeline.","Route Arabic NER to a custom CRFClassifier model if needed.","Keep language-support tables in pipeline configuration."],"tags":["nlp","unsupported-language","ner","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"}