add support for word overrides in sentiment node

This commit is contained in:
Luis Montes 2014-03-29 14:27:09 -07:00
parent c24cf9c1c2
commit 8b138ff2c8
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);
});