* Fix Issue #44: Broken Token.string attribute when single word sentence

This commit is contained in:
Matthew Honnibal 2015-04-07 06:08:25 +02:00
parent 085574ccc1
commit cff2b13fef

View File

@ -379,6 +379,8 @@ cdef class Token:
property string: property string:
def __get__(self): def __get__(self):
if (self.i+1) == self._seq.length:
return self._string[self.c.idx:]
cdef int next_idx = (self.c + 1).idx cdef int next_idx = (self.c + 1).idx
if next_idx < self.c.idx: if next_idx < self.c.idx:
next_idx = self.c.idx + self.c.lex.length next_idx = self.c.idx + self.c.lex.length