Suppose I have a list of words in Python (if necessary, already sorted according to the collation rules):
palavras = [
u"acentuacao",
u"divagacão",
u"programaçao",
u"taxação",
]
Notice that I have not used cedilla ( ç
) nor tilde ( ã
) consistently. How can I search in this list by "programming" but ignoring the accent so that multiple search modalities return results? Ex.:
buscar(palavras, u"programacao")
buscar(palavras, u"programação")
I searched Google for "collation search" and found nothing useful. I also searched for "ignoring accents search" in a variety of ways, and even found a MySQL solution (which confirms that the right path is even via collate ), but nothing for Python (just references to how to sort a list , which in itself does not answer the question). The module locale
also did not offer much help. How to do?