Skip to content

calling sents() on empty string #411

Closed
@nartz

Description

I guess it was unexpected to get this error:
[s for s in nlp(u'').sents] -> IndexError: list index out of range

I.e. calling sents on an empty string errors out - I wonder if this is the right behavior, or if sents should return an empty array?

Activity

added
bugBugs and behaviour differing from documentation
on Sep 7, 2016
syllog1sm

syllog1sm commented on Sep 7, 2016

@syllog1sm
Contributor

Thanks.

This should either return an empty list or yield out of an empty generator (off the top of my head, I don't remember whether .sents is a generator...Which is probably a bad sign. =/)

added this to the Version 1.0 Release milestone on Sep 21, 2016
added a commit that references this issue on Sep 27, 2016

Test and fix Issue #411: IndexError when .sents property is used on e…

lock

lock commented on May 9, 2018

@lock

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

locked as resolved and limited conversation to collaborators on May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugBugs and behaviour differing from documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      calling sents() on empty string · Issue #411 · explosion/spaCy