* Fix negative index for __getitem__

This commit is contained in:
Matthew Honnibal 2015-02-07 12:58:46 -05:00
parent ef795aece8
commit ab8bb047d0

View File

@ -102,7 +102,7 @@ cdef class Tokens:
token (Token):
"""
if i < 0:
i = self.length - i
i = self.length + i
bounds_check(i, self.length, PADDING)
return Token.cinit(self.vocab, self._string,
&self.data[i], i, self.length,