fix synonym bug (#3506)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2024-11-20 09:38:54 +08:00 committed by Yingfeng Zhang
parent 2044bb0039
commit 17a7ea42eb

View File

@ -68,7 +68,7 @@ class Dealer:
def lookup(self, tk):
if re.match(r"[a-z]+$", tk):
res = list(set([re.sub("_", " ", syn.name().split(".")[0]) for syn in wordnet.synsets("love")]) - set([tk]))
res = list(set([re.sub("_", " ", syn.name().split(".")[0]) for syn in wordnet.synsets(tk)]) - set([tk]))
return [t for t in res if t]
self.lookup_num += 1