Skip to content

Instantly share code, notes, and snippets.

@octoparse
Created April 16, 2019 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save octoparse/1856de1e0491402e607dcea230caacb1 to your computer and use it in GitHub Desktop.
Save octoparse/1856de1e0491402e607dcea230caacb1 to your computer and use it in GitHub Desktop.
# count if it is a positive word
if word in p_list:
if word in word_count_positive.keys():
word_count_positive[word] += 1
else:
word_count_positive[word] = 1
# else see if it is a negative word
elif word in n_list:
if word in word_count_negative.keys():
word_count_negative[word] += 1
else:
word_count_negative[word] = 1
else: # do nothing
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment