Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
updated the color codes
  • Loading branch information
Maryam Ashoori authored Jan 1, 2017
1 parent dca8e61 commit 566b0f9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions recipes/sentiment_analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,25 @@ The default sentiment keyword is set to 'happy' but you can change it from confi

edit config.js
Update searchkeyword
searchkeyword = "happy";
searchkeyword = "people";

The default behaviour of the module assigns the following colors to sentiments.

| Emotion | Color |
| --- | --- |
| Anger | Red |
| Joy | Yellow |
| Fear | Green |
| Disgust | Blue |
| Sadness | Magenta |
| Fear | Purple |
| Disgust | Green |
| Sadness | Blue |

You can change this mapping by editing `sentiment.js` to add your favorite colors. Note that colors are specified using the hexademical format.

var red = 0x00ff00 ;
var green = 0xff0000 ;
var blue = 0x0000ff ;
var yellow = 0xffff00 ;
var magenta = 0x00ffff ;
var purple = 0x00ffff ;

function processEmotion(emotion){
console.log("Current Emotion Around " + searchkeyword + " is ", emotion.tone_id);
Expand All @@ -102,11 +102,11 @@ You can change this mapping by editing `sentiment.js` to add your favorite color
}else if(emotion.tone_id == "joy"){
setLED(yellow);
}else if(emotion.tone_id == "fear"){
setLED(green);
setLED(purple);
}else if(emotion.tone_id == "disgust"){
setLED(blue);
setLED(green);
}else if(emotion.tone_id == "sadness"){
setLED(magenta);
setLED(blue);
}
}

Expand Down

0 comments on commit 566b0f9

Please sign in to comment.