Closed Starkie closed 3 years ago
Fixes #2
The key anticipation does not appear when no word related to that emotion is used. It seems to be related to how the keys of the frequencies are handled:
anticipation
First, the anticip key is always present, since it is in the affect_percent dict. But it is never used. https://github.com/metalcorebear/NRCLex/blob/5d66076ad897a2c9406d6c2a3b3d7b7cb3b25644/nrclex.py#L26
anticip
affect_percent
The anticipation key is added instead through the frequencies collection.
The key is added here: https://github.com/metalcorebear/NRCLex/blob/5d66076ad897a2c9406d6c2a3b3d7b7cb3b25644/nrclex.py#L23-L24
And it is added to the affect_frequencies here https://github.com/metalcorebear/NRCLex/blob/5d66076ad897a2c9406d6c2a3b3d7b7cb3b25644/nrclex.py#L28-L29
affect_frequencies
Replacing the anticip key by anticipation should fix it.
@metalcorebear Sorry to bother you. Could you review this change, please?
Thanks for doing this! Just merged.
Fixes #2
The key
anticipation
does not appear when no word related to that emotion is used. It seems to be related to how the keys of the frequencies are handled:First, the
anticip
key is always present, since it is in theaffect_percent
dict. But it is never used. https://github.com/metalcorebear/NRCLex/blob/5d66076ad897a2c9406d6c2a3b3d7b7cb3b25644/nrclex.py#L26The
anticipation
key is added instead through the frequencies collection.The key is added here: https://github.com/metalcorebear/NRCLex/blob/5d66076ad897a2c9406d6c2a3b3d7b7cb3b25644/nrclex.py#L23-L24
And it is added to the
affect_frequencies
here https://github.com/metalcorebear/NRCLex/blob/5d66076ad897a2c9406d6c2a3b3d7b7cb3b25644/nrclex.py#L28-L29Replacing the
anticip
key byanticipation
should fix it.