mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
* Fix Issue #44: Broken Token.string attribute when single word sentence
This commit is contained in:
parent
085574ccc1
commit
cff2b13fef
|
@ -379,6 +379,8 @@ cdef class Token:
|
|||
|
||||
property string:
|
||||
def __get__(self):
|
||||
if (self.i+1) == self._seq.length:
|
||||
return self._string[self.c.idx:]
|
||||
cdef int next_idx = (self.c + 1).idx
|
||||
if next_idx < self.c.idx:
|
||||
next_idx = self.c.idx + self.c.lex.length
|
||||
|
|
Loading…
Reference in New Issue
Block a user