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

Fix to support other languages #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Relfos
Copy link

@Relfos Relfos commented Sep 26, 2017

The current version has major problems for supporting non-english users.
First, it uses the current system culture while trying to parse decimals with dot, which causes an exception to be thrown when running Vader in a OS with Portuguese language (probably will fail in French and other languages).

Second, it uses an hardcoded lexicon file which is great for English but this library should also be able to analyze texts from other languages. For that, I added an second constructor that takes a file name as argument, to let the programmer load a custom lexicon file.

Finally, due that previous change, I removed the static constructor and static lexicon dictionary.
The programmer can keep an instance of an SentimentIntensityAnalyzer and reuse it as necessary. And now with the addition of custom lexicon files, we might need to have multiple lexicon files loaded, so the dictionary can no longer be static.

@codingupastorm
Copy link
Owner

Sweet thanks for this, will check it out and merge asap :)

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

Successfully merging this pull request may close these issues.

2 participants