Skip to content

Commit

Permalink
nrHits is defined regardless of DEBUG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo-ter-Doest committed Nov 20, 2023
1 parent 342a202 commit 6c904b7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/natural/sentiment/SentimentAnalyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ class SentimentAnalyzer {
getSentiment (words) {
let score = 0
let negator = 1
if (DEBUG) {
let nrHits = 0
}
let nrHits = 0

words.forEach((token) => {
const lowerCased = token.toLowerCase()
Expand All @@ -158,7 +156,7 @@ class SentimentAnalyzer {
})

score = score / words.length
DEBUG && console.log("Number of hits: " + nrHits);
DEBUG && console.log("Number of hits: " + nrHits)

return score
}
Expand Down

0 comments on commit 6c904b7

Please sign in to comment.