thisandagain / sentiment

AFINN-based sentiment analysis for Node.js.
MIT License
2.64k stars 311 forks source link

Inverse words if not #175

Closed auryn31 closed 4 years ago

auryn31 commented 4 years ago

Hy

is there a way to add inverses? For example (cats are not stupid)? So that stupid is positiv in this situation?

Thanks for help

elyas-bhy commented 4 years ago

This library already handles this case. Have you tested it? Refer to the files /languages/en/scoring-strategy.js and /languages/en/negators.json if you're curious on how that works.

I'm closing this issue since this is already supported. Feel free to reopen it if necessary.

auryn31 commented 4 years ago

I want to add a new language and asked myself, how can i add the negators...

elyas-bhy commented 4 years ago

Refer to this README section to learn more about adding new languages.

auryn31 commented 4 years ago

Thanks, but there is no part for negators.

Did i only have to add it to the language part with

const language = {
    labels: {...},
    negators: {...} 
};

Thanks for the help

elyas-bhy commented 4 years ago

The negators are part of the scoring strategy, are not declared at the top-level. This is because some other languages have more complex negation constructs. Please refer to this repo's languages/en folder to see how to structure your files.

auryn31 commented 4 years ago

Ok, thanks a lot.