Skip to content

Commit

Permalink
Fix Issues:
Browse files Browse the repository at this point in the history
In Python 3.5 cjhutto#18
Python 3 cjhutto#11
Python 3 cjhutto#10
Print statement format not supported in Python 3.x cjhutto#19
  • Loading branch information
ronjohn4 committed Dec 2, 2016
1 parent 15372a9 commit 8c75264
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build/lib/vaderSentiment/vaderSentiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
Weblogs and Social Media (ICWSM-14). Ann Arbor, MI, June 2014.
'''

import os, math, re, sys, fnmatch, string
import os, math, re, sys, fnmatch, string
from importlib import reload
reload(sys)

def make_lex_dict(f):
return dict(map(lambda (w, m): (w, float(m)), [wmsr.strip().split('\t')[0:2] for wmsr in open(f) ]))
return dict(map(lambda wm: (wm[0], float(wm[1])), [wmsr.strip().split('\t')[0:2] for wmsr in open(f) ]))

f = 'vader_sentiment_lexicon.txt' # empirically derived valence ratings for words, emoticons, slang, swear words, acronyms/initialisms
try:
Expand Down Expand Up @@ -356,8 +357,7 @@ def scalar_inc_dec(word, valence):
]
sentences.extend(tricky_sentences)
for sentence in sentences:
print sentence,
ss = sentiment(sentence)
print "\t" + str(ss)
print(sentence + "\t" + str(ss))

print "\n\n Done!"
print("\n\n Done!")

0 comments on commit 8c75264

Please sign in to comment.