MCPcopy Index your code
hub / github.com/pytorch/tutorials / unicodeToAscii

Function unicodeToAscii

beginner_source/chatbot_tutorial.py:333–337  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

331# Turn a Unicode string to plain ASCII, thanks to
332# https://stackoverflow.com/a/518232/2809427
333def unicodeToAscii(s):
334 return ''.join(
335 c for c in unicodedata.normalize('NFD', s)
336 if unicodedata.category(c) != 'Mn'
337 )
338
339# Lowercase, trim, and remove non-letter characters
340def normalizeString(s):

Callers 1

normalizeStringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected