mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-10 16:22:29 +03:00
Fix Span.sents issue.
This commit is contained in:
parent
7851f6eb8e
commit
97018de33b
|
@ -463,6 +463,11 @@ cdef class Span:
|
||||||
elif i == self.doc.length - 1:
|
elif i == self.doc.length - 1:
|
||||||
yield Span(self.doc, start, self.doc.length)
|
yield Span(self.doc, start, self.doc.length)
|
||||||
|
|
||||||
|
# Ensure that trailing parts of the Span instance are included in last element of .sents.
|
||||||
|
if start == self.doc.length - 1:
|
||||||
|
yield Span(self.doc, start, self.doc.length)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ents(self):
|
def ents(self):
|
||||||
"""The named entities that fall completely within the span. Returns
|
"""The named entities that fall completely within the span. Returns
|
||||||
|
|
Loading…
Reference in New Issue
Block a user