Il 28/01/2015 18:15, Marco Ippolito ha scritto:
Ciao a tutti,
ho messo in file json alcune possibili sostituzioni di simboli
all'interno di un testo:
"to_substitute":{
"“": "'",
"”": "'",
"—": "-",
"’": "'",
"è": "e'",
"é": "e'"
}
import unicodedata
def elimina_accenti(stringa):
return ''.join((c for c in unicodedata.normalize('NFD', stringa) if
unicodedata.category(c) != 'Mn'))
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python