mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +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):
|
||||
return u''.join([t.string for t in self])
|
||||
|
||||
def __str__(self):
|
||||
return u''.join([t.string for t in self])
|
||||
|
||||
@property
|
||||
def string(self):
|
||||
return unicode(self)
|
||||
return u''.join([t.string for t in self])
|
||||
|
||||
@property
|
||||
def ents(self):
|
||||
|
|
|
@ -34,6 +34,9 @@ cdef class Token:
|
|||
def __unicode__(self):
|
||||
return self.string
|
||||
|
||||
def __str__(self):
|
||||
return self.string
|
||||
|
||||
cpdef bint check_flag(self, attr_id_t flag_id) except -1:
|
||||
return check_flag(self.c.lex, flag_id)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user