Created
September 2, 2014 16:19
-
-
Save damianesteban/ea9fca3800110a98718f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
afinn = dict(map(lambda (k,v): (k,int(v)), | |
[line.split('\t') for line in open("AFINN-111.txt") ])) | |
afinn["Good".lower()] | |
sum(map(lambda word: afinn.get(word, 0), "Rainy day but still in a good mood".lower().split())) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment