Skip to content

Commit

Permalink
Update common.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong committed Dec 12, 2023
1 parent 2e2f878 commit d9aa851
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pythainlp/corpus/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ def find_synonyms(word: str) -> List[str]:
list_synonym.extend(synonyms["synonym"][idx])
list_synonym.append(synonyms["word"][idx])

list_synonym = sorted(list(set(list_synonym)))

if word in list_synonym: # remove same word
list_synonym.remove(word)

return sorted(list(set(list_synonym)))
return list_synonym

0 comments on commit d9aa851

Please sign in to comment.