mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
* Fix negative indices on spans
This commit is contained in:
parent
320836e346
commit
d153f18969
|
@ -40,6 +40,8 @@ cdef class Span:
|
|||
return self.end - self.start
|
||||
|
||||
def __getitem__(self, int i):
|
||||
if i < 0:
|
||||
i = len(self) - i
|
||||
return self._seq[self.start + i]
|
||||
|
||||
def __iter__(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user