From 2b1b65e5ab83d08388799761abdcf242de099618 Mon Sep 17 00:00:00 2001 From: sublimotion Date: Fri, 10 May 2013 16:00:07 -0300 Subject: [PATCH] Update term_sentiment.py replace new line character with a space for tweet to improve error handling. --- term_sentiment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/term_sentiment.py b/term_sentiment.py index 17a5801..2f20beb 100644 --- a/term_sentiment.py +++ b/term_sentiment.py @@ -46,6 +46,8 @@ def main(): new_term = {} for word in tweet_word: word = word.rstrip('?:!.,;"!@') + # + word.replace("\n", " ") if word.encode('utf-8', "ignore") in sentiment.keys(): sent_score = sent_score + float(sentiment[word]) else: