File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def analyze_entities(text, encoding='UTF32'):
5555 'type' : 'PLAIN_TEXT' ,
5656 'content' : text ,
5757 },
58- 'encodingType ' : encoding ,
58+ 'encoding_type ' : encoding ,
5959 }
6060
6161 service = get_service ()
@@ -66,12 +66,13 @@ def analyze_entities(text, encoding='UTF32'):
6666 return response
6767
6868
69- def analyze_sentiment (text ):
69+ def analyze_sentiment (text , encoding = 'UTF32' ):
7070 body = {
7171 'document' : {
7272 'type' : 'PLAIN_TEXT' ,
7373 'content' : text ,
74- }
74+ },
75+ 'encoding_type' : encoding
7576 }
7677
7778 service = get_service ()
@@ -112,7 +113,7 @@ def analyze_syntax(text, encoding='UTF32'):
112113 if args .command == 'entities' :
113114 result = analyze_entities (args .text , get_native_encoding_type ())
114115 elif args .command == 'sentiment' :
115- result = analyze_sentiment (args .text )
116+ result = analyze_sentiment (args .text , get_native_encoding_type () )
116117 elif args .command == 'syntax' :
117118 result = analyze_syntax (args .text , get_native_encoding_type ())
118119
You can’t perform that action at this time.
0 commit comments