mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
* Fix string coercion for Python 3
This commit is contained in:
parent
c4ff410fdb
commit
0bb839d299
|
@ -111,9 +111,12 @@ cdef class Doc:
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return u''.join([t.string for t in self])
|
return u''.join([t.string for t in self])
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return u''.join([t.string for t in self])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def string(self):
|
def string(self):
|
||||||
return unicode(self)
|
return u''.join([t.string for t in self])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ents(self):
|
def ents(self):
|
||||||
|
|
|
@ -34,6 +34,9 @@ cdef class Token:
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.string
|
return self.string
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.string
|
||||||
|
|
||||||
cpdef bint check_flag(self, attr_id_t flag_id) except -1:
|
cpdef bint check_flag(self, attr_id_t flag_id) except -1:
|
||||||
return check_flag(self.c.lex, flag_id)
|
return check_flag(self.c.lex, flag_id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user