OpenHowNet icon indicating copy to clipboard operation
OpenHowNet copied to clipboard

Code error: .get_sememes_by_word

Open MrCCecho opened this issue 1 year ago • 0 comments

If you run the 'obj.get_sememes_by_word', you will get a TypeError: TypeError: unsupported operand type(s) for |=: 'set' and 'list' "res = set() sememe_x = self.get_sememe(x, strict=strict) for s_x in sememe_x: res |= s_x.get_senses() return list(res)"

You need add set() to s_x.get_senses(). "res = set() sememe_x = self.get_sememe(x, strict=strict) for s_x in sememe_x: res |= set(s_x.get_senses()) return list(res)"

MrCCecho avatar Apr 24 '23 12:04 MrCCecho