stanfordnlp/CoreNLP · error · IllegalArgumentException
Dependency parsing is not implemented for Arabic
Error message
Dependency parsing is not implemented for Arabic
What it means
ArabicDocument.runDepparse() throws IllegalArgumentException because dependency parsing is not implemented for Arabic in the stanford.nlp.simple API. Any call to Document.depparse() on an Arabic document reaches this stub and fails.
Solutions
- Skip depparse for ArabicDocument instances (instanceof check before calling).
- Use a supported language document for dependency parsing.
- Train/wire an Arabic dependency model via the full CoreNLP annotator pipeline outside the simple API.
Example fix
// before
doc.depparse();
// after
if (!(doc instanceof ArabicDocument)) {
doc.depparse();
} Defensive patterns
Strategy: type-guard
Validate before calling
if (doc instanceof edu.stanford.nlp.simple.ArabicDocument) skipDepparse = true;
Type guard
boolean supportsDepparse(Document doc) { return !(doc instanceof edu.stanford.nlp.simple.ArabicDocument); } Try / catch
try {
doc.depparse();
} catch (IllegalArgumentException e) {
if (e.getMessage() != null && e.getMessage().contains("not implemented")) {
log.warn("Dependency parsing unavailable for this language, skipping");
} else throw e;
} Prevention
- Check ArabicDocument javadoc for the list of unsupported operations before building pipelines.
- Use per-language annotation requirement maps.
- Never assume the neural dependency parser supports all languages.
When it happens
Trigger: Calling depparse() on an ArabicDocument, or running an annotator pipeline that requires dependency parse as a prerequisite (e.g. coref-style operations) on Arabic text.
Common situations: Multilingual pipelines applying the same annotation set to all languages; assuming the neural dependency parser supports Arabic.
Related errors
- Sentiment analysis is not implemented for Arabic
- NER is not implemented for Arabic
- Coreference is not implemented for Arabic
- this.getClass().getName() + ": Case is presently…
- Arabic does not support feature type: " + feat.toString()
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/0d593baf0c4025d9.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/simple/ArabicDocument.java:89
* No lemma annotator for Arabic -- set the lemma to be the word.
*
* @see Document#runLemma(Properties)
*/
@Override
protected Document runLemma(Properties props) {
return mockLemma(props);
}
@Override
protected Document runSentiment(Properties props) {
throw new IllegalArgumentException("Sentiment analysis is not implemented for Arabic");
}
@Override
protected Document runDepparse(Properties props) {
throw new IllegalArgumentException("Dependency parsing is not implemented for Arabic");
}
@Override
protected Document runNER(Properties props) {
throw new IllegalArgumentException("NER is not implemented for Arabic");
}
@Override
public Map<Integer, CorefChain> coref(Properties props) {
throw new IllegalArgumentException("Coreference is not implemented for Arabic");
}
}
View on GitHub (pinned to 1b7edd19c4)