Camille
commited on
Commit
·
01fce0e
1
Parent(s):
43b8437
fix: extract
Browse files- rhyme_with_ai/utils.py +3 -1
rhyme_with_ai/utils.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import itertools
|
2 |
import string
|
3 |
import random
|
|
|
|
|
4 |
|
5 |
|
6 |
def color_new_words(new: str, old: str, color: str = "#eefa66") -> str:
|
@@ -55,7 +57,7 @@ def extract(filename):
|
|
55 |
return : list de tuples (ortho, phon)
|
56 |
"""
|
57 |
words = []
|
58 |
-
with open(filename, 'r') as f:
|
59 |
f.readline() # première ligne
|
60 |
for line in f:
|
61 |
ortho, phon = line.split('\t')[0:2]
|
|
|
1 |
import itertools
|
2 |
import string
|
3 |
import random
|
4 |
+
import os
|
5 |
+
import sys
|
6 |
|
7 |
|
8 |
def color_new_words(new: str, old: str, color: str = "#eefa66") -> str:
|
|
|
57 |
return : list de tuples (ortho, phon)
|
58 |
"""
|
59 |
words = []
|
60 |
+
with open(os.path.join(sys.path[0], filename), 'r') as f:
|
61 |
f.readline() # première ligne
|
62 |
for line in f:
|
63 |
ortho, phon = line.split('\t')[0:2]
|