Created
December 12, 2017 15:53
-
-
Save Irio/bc86eed5db55079609da2e71ba3e1ac3 to your computer and use it in GitHub Desktop.
normalize_string.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unicodedata | |
def normalize_string(string): | |
if isinstance(string, str): | |
nfkd_form = unicodedata.normalize('NFKD', string.lower()) | |
return nfkd_form.encode('ASCII', 'ignore').decode('utf-8') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment