diff --git a/lexicons/vader_lexicon_ptbr.txt b/lexicons/vader_lexicon_ptbr.txt index 12d0c63..d63a10a 100644 --- a/lexicons/vader_lexicon_ptbr.txt +++ b/lexicons/vader_lexicon_ptbr.txt @@ -4670,6 +4670,10 @@ pessimista -1.5 1.36015 [-1, -3, 1, -2, -2, -2, 1, -3, -2, -2] pessimista -1.5 1.43178 [-3, -1, -1, 1, -3, -3, -2, -2, -2, 1] pessimista -2.0 1.0 [-1, -1, -3, -4, -2, -1, -1, -3, -2, -2] pessimistas -1.0 1.26491 [-1, 1, -1, 0, -2, -2, -2, -3, -1, 1] +pessima -3.1 1.04403 [-4, -4, -3, -1, -3, -4, -2, -2, -4, -4] +pessimas -3.1 1.04403 [-4, -4, -3, -1, -3, -4, -2, -2, -4, -4] +pessimo -3.1 1.04403 [-4, -4, -3, -1, -3, -4, -2, -2, -4, -4] +pessimos -3.1 1.04403 [-4, -4, -3, -1, -3, -4, -2, -2, -4, -4] petrificacao -1.9 1.3 [-3, -2, -1, -4, -3, 0, -1, 0, -2, -3] petrificacoes -0.3 1.00499 [0, -1, 0, 0, 0, 0, 0, 0, -3, 1] petrificacao -0.1 1.44568 [-1, 2, -1, -1, 0, 2, 2, -2, -1, -1] diff --git a/tests/test_sentiment.py b/tests/test_sentiment.py new file mode 100644 index 0000000..6959dc3 --- /dev/null +++ b/tests/test_sentiment.py @@ -0,0 +1,17 @@ +from unittest import TestCase + +from leia import SentimentIntensityAnalyzer + + +class PortugueseLexiconTests(TestCase): + def setUp(self): + self.analyzer = SentimentIntensityAnalyzer() + + def test_pessimo_is_classified_as_negative(self): + for word in ("péssimo", "péssima", "péssimos", "péssimas"): + with self.subTest(word=word): + scores = self.analyzer.polarity_scores( + f"O atendimento foi {word}" + ) + self.assertLess(scores["compound"], -0.05) + self.assertGreater(scores["neg"], 0)