Skip to content

Code error: .get_sememes_by_word #32

Description

@MrCCecho

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)"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions