Spaces:
Runtime error
Runtime error
seriouspark
commited on
Commit
โข
7780ccc
1
Parent(s):
e146f1d
Update app.py
Browse files
app.py
CHANGED
@@ -244,7 +244,7 @@ def get_similar_vocab(message):
|
|
244 |
# "similarWordName" ๋ค์์ ๋จ์ด ์ถ์ถ
|
245 |
similar_words = re.findall(r'similarWordName:"([^"]+)"', resulttext)
|
246 |
similar_words_final = list(set(sum([re.findall('[๊ฐ-ํฃ]+', i) for i in similar_words], [])))
|
247 |
-
|
248 |
return similar_words_final
|
249 |
else:
|
250 |
return '๋จ์ด๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์'
|
@@ -261,7 +261,7 @@ def get_similar_means(vocab):
|
|
261 |
|
262 |
# "meanList" ๋ค์์ ๋ฆฌ์คํธ ์ถ์ถ (๋ฆฌ์คํธ ๋ด์ฉ์ ๋ฌธ์์ด๋ก ์ถ์ถ)
|
263 |
mean_list_str = re.findall(r'meanList:(\[.*?\])', resulttext, re.DOTALL)
|
264 |
-
|
265 |
matches_list = []
|
266 |
for i in range(len(mean_list_str)):
|
267 |
matches = re.findall(r'mean:"(.*?)"', mean_list_str[i])
|
|
|
244 |
# "similarWordName" ๋ค์์ ๋จ์ด ์ถ์ถ
|
245 |
similar_words = re.findall(r'similarWordName:"([^"]+)"', resulttext)
|
246 |
similar_words_final = list(set(sum([re.findall('[๊ฐ-ํฃ]+', i) for i in similar_words], [])))
|
247 |
+
similar_words_final = [i for i in set(sum([re.findall('[๊ฐ-ํฃ]+', i) for i in similar_words], [])) if i not in ('๋ฑ๋ง','๋ง','์ด์ฌ')]
|
248 |
return similar_words_final
|
249 |
else:
|
250 |
return '๋จ์ด๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์'
|
|
|
261 |
|
262 |
# "meanList" ๋ค์์ ๋ฆฌ์คํธ ์ถ์ถ (๋ฆฌ์คํธ ๋ด์ฉ์ ๋ฌธ์์ด๋ก ์ถ์ถ)
|
263 |
mean_list_str = re.findall(r'meanList:(\[.*?\])', resulttext, re.DOTALL)
|
264 |
+
mean_list_str = [i.replace('\\u002F','').replace('\\u003C','').replace('strong','').replace('\\u003E','') for i in mean_list_str]
|
265 |
matches_list = []
|
266 |
for i in range(len(mean_list_str)):
|
267 |
matches = re.findall(r'mean:"(.*?)"', mean_list_str[i])
|