EntityMentions returns null instead of empty list
cholojuanito opened this issue · 3 comments
cholojuanito commented
I ran into an issue where if an empty string is passed in then getting the entityMentions returns null instead of an empty list like I figure out be standard practice.
Example code:
StanfordCoreNLP processor = new StanfordCoreNLP(props);
CoreDocument nlpDocument = new CoreDocument("");
nlpProcessor.annotate(nlpDocument);
List<CoreEntityMention> entities = nlpDocument.entityMentions(); <== returns null
Just wanted to know if there is any light that can be shed on this. If this is expected behavior then I will try my best to document it in the documentation
AngledLuffa commented
That is a little weird. I updated it to return an empty list in the case of an empty document
cholojuanito commented
Thanks for the quick response. It's an edge case I ran into at work today.
AngledLuffa commented
4.5.2 is now released, including this bugfix