seriouspark commited on
Commit
7780ccc
โ€ข
1 Parent(s): e146f1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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])