1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #187 from monteslu/sentiment

Add support for word overrides feature in sentiment node
This commit is contained in:
Nick O'Leary 2014-04-16 11:07:29 +01:00
commit 9ad4d50442
2 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@
<p>Analyses the <b>msg.payload</b> and adds a <b>msg.sentiment</b> object that contains the resulting AFINN-111 sentiment score as <b>msg.sentiment.score</b>.</p>
<p>A score greater than zero is positive and less than zero is negative.</p>
<p>The score typically ranges from -5 to +5, but can go higher and lower.</p>
<p>An object of word score overrides can be supplied as <b>msg.overrides</b>.</p>
<p>See <a href="https://github.com/thisandagain/sentiment/blob/master/README.md" target="_new">the Sentiment docs here</a>.</p>
</script>

View File

@ -22,7 +22,7 @@ function SentimentNode(n) {
var node = this;
this.on("input", function(msg) {
sentiment(msg.payload, function (err, result) {
sentiment(msg.payload, msg.overrides || null, function (err, result) {
msg.sentiment = result;
node.send(msg);
});