mirror of https://github.com/explosion/spaCy.git
Remove deprecation shim around str/bytes in Token.
This commit is contained in:
parent
b67697a97b
commit
7fd98fc91c
|
@ -43,20 +43,10 @@ cdef class Token:
|
||||||
return self.c.lex.length
|
return self.c.lex.length
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
# Users can toggle this on to preserve former buggy semantics.
|
return self.text
|
||||||
# Remove this in future versions.
|
|
||||||
if _STR_TRAILING_WHITESPACE:
|
|
||||||
return self.text_with_ws
|
|
||||||
else:
|
|
||||||
return self.text
|
|
||||||
|
|
||||||
def __bytes__(self):
|
def __bytes__(self):
|
||||||
# Users can toggle this on to preserve former buggy semantics.
|
return self.text.encode('utf8')
|
||||||
# Remove this in future versions.
|
|
||||||
if _STR_TRAILING_WHITESPACE:
|
|
||||||
return self.text_with_ws.encode('utf8')
|
|
||||||
else:
|
|
||||||
return self.text.encode('utf8')
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
|
|
Loading…
Reference in New Issue