From 6b68f7ef7511abddf322f1f2133703cd181ba5f8 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 6 Jan 2015 03:17:39 +1100 Subject: [PATCH] * Finally get string types right for orth function --- spacy/orth.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/orth.pyx b/spacy/orth.pyx index 83e565b86..2cd21279f 100644 --- a/spacy/orth.pyx +++ b/spacy/orth.pyx @@ -138,7 +138,7 @@ cpdef unicode word_shape(unicode string): cpdef bytes asciied(unicode string): - ascii_string = unidecode(string) - if not ascii_string: + cdef str stripped = unidecode(string) + if not stripped: return b'???' - return ascii_string + return stripped.encode('ascii')