Skip to content

EntityMentions returns null instead of empty list #1322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cholojuanito opened this issue Dec 7, 2022 · 3 comments
Closed

EntityMentions returns null instead of empty list #1322

cholojuanito opened this issue Dec 7, 2022 · 3 comments

Comments

@cholojuanito
Copy link

cholojuanito commented Dec 7, 2022

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 added a commit that referenced this issue Dec 8, 2022
…being set), return an empty list of entityMentions for an empty document. Addresses #1322
@AngledLuffa
Copy link
Contributor

That is a little weird. I updated it to return an empty list in the case of an empty document

@cholojuanito
Copy link
Author

Thanks for the quick response. It's an edge case I ran into at work today.

AngledLuffa added a commit that referenced this issue Jan 20, 2023
…being set), return an empty list of entityMentions for an empty document. Addresses #1322
@AngledLuffa
Copy link
Contributor

4.5.2 is now released, including this bugfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants