Maybe a simple typo in tweets here score = analyzer.analyze(tweets), since you want to send one tweet at a time. Also, beware here: token.lower(). The lower method returns the string in lower case, it does not change the string to lower case. You might try ./smile LOVE or ./smile HATE to see what result you get.


Why do you use open with self.positives? As self.positives is a set, you could simply use if token in self.positives: or maybe if token.lower() in self.positives: Also, return the score, not just -1, 0, or 1.

Only top voted, non community-wiki answers of a minimum length are eligible