]>
gitweb.pimeys.fr Git - bots/hung.git/blob - convert_dico.py
7 f
=open("dico_for_python.txt")
11 l
=re
.findall('"(.*)","(.*)"',t
)
14 texte
=unicode(texte
,"utf8").lower()
43 for avant
,apres
in remplacements
.items():
44 texte
=texte
.replace(avant
,apres
)
47 l
=[[maju(i
[0]),i
[0]+" : "+i
[1].replace("\\n","; ")] for i
in l
50 and not i
[0][-1]=='-'] # les mots finissant par un tiret foiraient
51 # en plus ils sont pas intéressants, donc on vire
53 f1
=open("mots.txt.out","w")
54 f2
=open("definitions.txt.out","w")
55 f1
.writelines([(i
[0]+"\n").encode("utf8") for i
in l
])
56 f2
.writelines([i
[1].decode("utf8").replace(u
"note",u
"nøte").replace(u
"Note",u
"Nøte").encode("utf8")+"\n" for i
in l
])