mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +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:
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user