-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Hi,
I got the following error while running char_rnn_classification_tutorial.py
print(unicodeToAscii('Ślusàrski'))
File "src/char_rnn.py", line 17, in unicodeToAscii
c for c in unicodedata.normalize('NFD', s)
TypeError: normalize() argument 2 must be unicode, not str
To circumvent the error I changed the code:
def unicodeToAscii(s):
try:
s = unicode(s, 'utf-8')
except NameError:
pass
s = unicodedata.normalize('NFD', s)
s = s.encode('ascii', 'ignore')
s = s.decode('utf-8')
return str(s)
Metadata
Metadata
Assignees
Labels
No labels