Skip to content

Commit

Permalink
Integrated Portuguese vocabulary in Sentimenter and added some tests. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo-ter-Doest authored Apr 27, 2022
1 parent 0635250 commit 38a5dd8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/natural/sentiment/SentimentAnalyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// Afinn
const englishAfinnVoca = require('afinn-165')
const spanishAfinnVoca = require('./Spanish/afinnShortSortedSpanish.json')
const portugueseAfinnVoca = require('./Portuguese/afinnShortSortedPortuguese.json')

// Senticon
const spanishSenticonVoca = require('./Spanish/senticon_es.json')
Expand All @@ -43,12 +44,14 @@ const frenchPatternVoca = require('./French/pattern-sentiment-fr.json')
const englishNegations = require('./English/negations_en.json').words
const spanishNegations = require('./Spanish/negations_es.json').words
const dutchNegations = require('./Dutch/negations_du.json').words
const portugueseNegations = require('./Portuguese/negations_pt.json').words

// Mapping from type of vocabulary to language to vocabulary
const languageFiles = {
afinn: {
English: [englishAfinnVoca, englishNegations],
Spanish: [spanishAfinnVoca, spanishNegations]
Spanish: [spanishAfinnVoca, spanishNegations],
Portuguese: [portugueseAfinnVoca, portugueseNegations]
},
senticon: {
Spanish: [spanishSenticonVoca, spanishNegations],
Expand Down
10 changes: 10 additions & 0 deletions spec/SentimentAnalyzer_spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 38a5dd8

Please # to comment.