1 """Modul pro odstranovani diakritiky a zvlastnich znaku."""
4 from spolecne import ABECEDA
7 """Vrati text bez akcentu. Pochybna metoda pouzivajici unicodedata."""
9 for aChar in unicodedata.normalize('NFD', unistr)
10 if not unicodedata.combining(aChar))
12 def ocesat(text, mezery=True):
13 """Odstrani z textu akcenty, zvlastni znaky nahradi mezerami, posloupnost
14 mezer jednou mezerou a prevede vsechna pismena na velka."""
15 text = deaccent(unicode(text)).upper()
30 return ''.join([c for c in text if c in ABECEDA])
35 sys.stdin = codecs.getreader('utf-8')(sys.stdin)
36 sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
37 for line in sys.stdin.readlines():
38 print " ".join(deaccent(line).lower().split())
40 if __name__ == '__main__':