From ab8bb047d0a982adcfa16406f9fd8610d087da52 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 7 Feb 2015 12:58:46 -0500 Subject: [PATCH] * Fix negative index for __getitem__ --- spacy/tokens.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/tokens.pyx b/spacy/tokens.pyx index 8795d6c63..870bbe4c9 100644 --- a/spacy/tokens.pyx +++ b/spacy/tokens.pyx @@ -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,