Skip to content

Commit

Permalink
Correct identation error in sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexellis committed May 3, 2017
1 parent edf62ab commit 657f88c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sample-functions/SentimentAnalysis/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import json
from textblob import TextBlob

# set default encoding to UTF-8 to eliminate decoding errors
# Set encoding to UTF-8 (vs ASCII to eliminate potential errors).
reload(sys)
sys.setdefaultencoding('utf8')

def get_stdin():
buf = ""
for line in sys.stdin:
buf = buf + line
return buf
return buf

if(__name__ == "__main__"):
st = get_stdin()
Expand All @@ -29,4 +29,5 @@ def get_stdin():
res["sentence_count"] = total
res["polarity"] = res["polarity"] / total
res["subjectivity"] = res["subjectivity"] / total

print(json.dumps(res))

0 comments on commit 657f88c

Please sign in to comment.