mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +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
|
return self.end - self.start
|
||||||
|
|
||||||
def __getitem__(self, int i):
|
def __getitem__(self, int i):
|
||||||
|
if i < 0:
|
||||||
|
i = len(self) - i
|
||||||
return self._seq[self.start + i]
|
return self._seq[self.start + i]
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user