* Fix type declaration in asciied function

This commit is contained in:
Matthew Honnibal 2015-10-09 13:46:57 +11:00
parent 9ff288c7bb
commit b125289f30

View File

@ -11,6 +11,7 @@ try:
except ImportError: except ImportError:
from text_unidecode import unidecode from text_unidecode import unidecode
import re import re
import math import math
@ -165,7 +166,7 @@ cpdef unicode norm1(unicode string, lower_pc=0.0, upper_pc=0.0, title_pc=0.0):
cpdef bytes asciied(unicode string): cpdef bytes asciied(unicode string):
cdef str stripped = unidecode(string) stripped = unidecode(string)
if not stripped: if not stripped:
return b'???' return b'???'
return stripped.encode('ascii') return stripped.encode('ascii')