mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +03:00
* Fix bug in Span.root
This commit is contained in:
parent
714cbc03d5
commit
14534958a9
|
@ -176,7 +176,7 @@ cdef class Span:
|
||||||
# in this case we return in linear time.
|
# in this case we return in linear time.
|
||||||
for i in range(self.start, self.end):
|
for i in range(self.start, self.end):
|
||||||
if self.doc.c[i].head == 0:
|
if self.doc.c[i].head == 0:
|
||||||
return i
|
return self.doc[i]
|
||||||
# If we don't have a sentence root, we do something that's not so
|
# If we don't have a sentence root, we do something that's not so
|
||||||
# algorithmically clever, but I think should be quite fast, especially
|
# algorithmically clever, but I think should be quite fast, especially
|
||||||
# for short spans.
|
# for short spans.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user