Skip to content

Commit

Permalink
Corrected README for getSentiment()
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo-ter-Doest committed May 29, 2018
1 parent b05a271 commit 6e70eb3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,9 @@ This is a simple sentiment analysis algorithm based on a vocabulary that assigns
```javascript
var Analyzer = require('natural').SentimentAnalyzer;
var stemmer = require('natural').PorterStemmer;
var analyzer = new Analyzer("English", stemmer, "afinn")
console.log(analyzer.getSentiment("I like cherries"));
var analyzer = new Analyzer("English", stemmer, "afinn");
// getSentiment expects an array of strings
console.log(analyzer.getSentiment(["I", "like", "cherries"]));
// 0.6666666666666666
```
The constructor has three parameters:
Expand Down

0 comments on commit 6e70eb3

Please sign in to comment.