Camille
commited on
Commit
•
8d252dd
1
Parent(s):
01fce0e
fix: path
Browse files- rhyme_with_ai/rhyme.py +1 -1
- rhyme_with_ai/utils.py +1 -3
rhyme_with_ai/rhyme.py
CHANGED
@@ -27,7 +27,7 @@ def query_rhyme_words(sentence: str, n_rhymes: int, language:str="english") -> L
|
|
27 |
elif language == "dutch":
|
28 |
return mick_rijmwoordenboek(last_word, n_rhymes)
|
29 |
elif language == "french":
|
30 |
-
lexique = extract('noms-lexique.org.txt')
|
31 |
dico_3 = mk_dico(lexique, 3)
|
32 |
return find_rhyme_french(last_word, dico_3, lexique, n_rhymes)
|
33 |
else:
|
|
|
27 |
elif language == "dutch":
|
28 |
return mick_rijmwoordenboek(last_word, n_rhymes)
|
29 |
elif language == "french":
|
30 |
+
lexique = extract('rhyme_with_ai/noms-lexique.org.txt')
|
31 |
dico_3 = mk_dico(lexique, 3)
|
32 |
return find_rhyme_french(last_word, dico_3, lexique, n_rhymes)
|
33 |
else:
|
rhyme_with_ai/utils.py
CHANGED
@@ -1,8 +1,6 @@
|
|
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,7 +55,7 @@ def extract(filename):
|
|
57 |
return : list de tuples (ortho, phon)
|
58 |
"""
|
59 |
words = []
|
60 |
-
with open(
|
61 |
f.readline() # première ligne
|
62 |
for line in f:
|
63 |
ortho, phon = line.split('\t')[0:2]
|
|
|
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 |
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]
|