diff --git a/spacy/tokens/doc.pyx b/spacy/tokens/doc.pyx index 72b83720e..771d93804 100644 --- a/spacy/tokens/doc.pyx +++ b/spacy/tokens/doc.pyx @@ -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): diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index 194205cc1..bbc12d549 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -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)