importer tout le dossier corpus
This commit is contained in:
1 parent
3c18739db0
commit
8f9987fcd2
2 files changed
+5
-5
No files matched your search
File renamed without changes.
@@ -1,11 +1,11 @@
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from random import choice, randrange
|
from pathlib import Path
|
||||||
|
from random import choice
|
||||||
|
|
||||||
|
|
||||||
suivants = defaultdict(list)
|
suivants = defaultdict(list)
|
||||||
for path in (
|
for chemin in Path("corpus").iterdir():
|
||||||
"fra_wikipedia_2021_10K-sentences.txt",
|
with open(chemin, "r", encoding="utf-8") as fichier:
|
||||||
):
|
|
||||||
with open(path, "r", encoding="utf-8") as fichier:
|
|
||||||
for phrase in fichier:
|
for phrase in fichier:
|
||||||
antepenultieme, penultieme = "", ""
|
antepenultieme, penultieme = "", ""
|
||||||
for word in phrase.split():
|
for word in phrase.split():
|
||||||
|
|||||||
Reference in new issue
Block a user