Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected KeyError in parsing.py #5

Open
iCSawyer opened this issue Dec 13, 2022 · 0 comments
Open

Unexpected KeyError in parsing.py #5

iCSawyer opened this issue Dec 13, 2022 · 0 comments

Comments

@iCSawyer
Copy link

iCSawyer commented Dec 13, 2022

impact = vword[tvalue]

Hello!

If one token's both stem and every element in its syns is not in vword, this snippet will raise KeyError because we cannot find the corresponding impact of this token.

Maybe this function assume that every token's stem or its thesaurus is in the dict vword.

It can be fixed by adding try...except... or add {this token's stem: 0} into vword.

Thank you for your replying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant