Skip to content

Commit fc3970f

Browse files
committed
Use safer ast.literal_eval
1 parent ac3eeab commit fc3970f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pythainlp/corpus/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
Common lists of words.
77
"""
88

9+
import ast
10+
911
__all__ = [
1012
"countries",
1113
"find_synonyms",
@@ -304,7 +306,7 @@ def thai_wsd_dict() -> dict:
304306
thai_wsd = thai_dict()
305307
_THAI_WSD_DICT = {"word": [], "meaning": []}
306308
for i, j in zip(thai_wsd["word"], thai_wsd["meaning"]):
307-
all_value = list(eval(j).values())
309+
all_value = list(ast.literal_eval(j).values())
308310
use = []
309311
for k in all_value:
310312
use.extend(k)

0 commit comments

Comments
 (0)