mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-13 05:07:03 +03:00
* Fix negative index for __getitem__
This commit is contained in:
parent
ef795aece8
commit
ab8bb047d0
|
@ -102,7 +102,7 @@ cdef class Tokens:
|
||||||
token (Token):
|
token (Token):
|
||||||
"""
|
"""
|
||||||
if i < 0:
|
if i < 0:
|
||||||
i = self.length - i
|
i = self.length + i
|
||||||
bounds_check(i, self.length, PADDING)
|
bounds_check(i, self.length, PADDING)
|
||||||
return Token.cinit(self.vocab, self._string,
|
return Token.cinit(self.vocab, self._string,
|
||||||
&self.data[i], i, self.length,
|
&self.data[i], i, self.length,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user