Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Paullux committed Sep 25, 2022
1 parent 9084df2 commit 9ec8dec
Show file tree
Hide file tree
Showing 4 changed files with 42,516 additions and 0 deletions.
43 changes: 43 additions & 0 deletions createWordListe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import json, os, unidecode

jsonWordListe = {
"a": [],
"b": [],
"c": [],
"d": [],
"e": [],
"f": [],
"g": [],
"h": [],
"i": [],
"j": [],
"k": [],
"l": [],
"m": [],
"n": [],
"o": [],
"p": [],
"q": [],
"r": [],
"s": [],
"t": [],
"u": [],
"v": [],
"w": [],
"x": [],
"y": [],
"z": []
}

if os.path.exists("liste_francais.txt"):
with open("liste_francais.txt", "r", encoding='utf-8') as file:
for mot in file:
mot = mot.split("\n")[0]
startLetter = unidecode.unidecode(mot[0]).lower()
jsonWordListe[startLetter].append(mot)

else:
print("error word list not exist")

with open("liste_francais.json", "w+", encoding='utf8') as file:
json.dump(jsonWordListe, file, indent = 4, ensure_ascii=False)
Loading

0 comments on commit 9ec8dec

Please sign in to comment.