mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
* Fix open-bounded slice indices.
This commit is contained in:
parent
e562f504ee
commit
ab694b0364
|
@ -91,9 +91,9 @@ cdef class Doc:
|
|||
raise ValueError("Stepped slices not supported in Span objects."
|
||||
"Try: list(doc)[start:stop:step] instead.")
|
||||
if i.start is None:
|
||||
i.start = 0
|
||||
i = slice(0, i.stop)
|
||||
if i.stop is None:
|
||||
i.stop = len(self)
|
||||
i = slice(i.start, len(self))
|
||||
return Span(self, i.start, i.stop, label=0)
|
||||
|
||||
if i < 0:
|
||||
|
|
Loading…
Reference in New Issue
Block a user