R sentiment analysis with phrases in dictionaries
I am performing sentiment analysis on a set of Tweets that I have and I now want to know how to add phrases to the positive and negative dictionaries. I've read in the files of the phrases I want to test but when running the sentiment analysis it doesn't give me a result. When reading through the sentiment algorithm, I can see that it is matching the words to the dictionaries but is there a way to scan for words as well as phrases? Here is the code: score.sentiment = function(sentences, pos.words, neg.words, .progress='none') { require(plyr) require(stringr) # we got a vector of sentences.