mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
Correct identation error in sample.
This commit is contained in:
parent
edf62ab150
commit
657f88cb6e
@ -2,7 +2,7 @@ import sys
|
|||||||
import json
|
import json
|
||||||
from textblob import TextBlob
|
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)
|
reload(sys)
|
||||||
sys.setdefaultencoding('utf8')
|
sys.setdefaultencoding('utf8')
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ def get_stdin():
|
|||||||
buf = ""
|
buf = ""
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
buf = buf + line
|
buf = buf + line
|
||||||
return buf
|
return buf
|
||||||
|
|
||||||
if(__name__ == "__main__"):
|
if(__name__ == "__main__"):
|
||||||
st = get_stdin()
|
st = get_stdin()
|
||||||
@ -29,4 +29,5 @@ if(__name__ == "__main__"):
|
|||||||
res["sentence_count"] = total
|
res["sentence_count"] = total
|
||||||
res["polarity"] = res["polarity"] / total
|
res["polarity"] = res["polarity"] / total
|
||||||
res["subjectivity"] = res["subjectivity"] / total
|
res["subjectivity"] = res["subjectivity"] / total
|
||||||
|
|
||||||
print(json.dumps(res))
|
print(json.dumps(res))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user