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'):
55
55
'type' : 'PLAIN_TEXT' ,
56
56
'content' : text ,
57
57
},
58
- 'encodingType ' : encoding ,
58
+ 'encoding_type ' : encoding ,
59
59
}
60
60
61
61
service = get_service ()
@@ -66,12 +66,13 @@ def analyze_entities(text, encoding='UTF32'):
66
66
return response
67
67
68
68
69
- def analyze_sentiment (text ):
69
+ def analyze_sentiment (text , encoding = 'UTF32' ):
70
70
body = {
71
71
'document' : {
72
72
'type' : 'PLAIN_TEXT' ,
73
73
'content' : text ,
74
- }
74
+ },
75
+ 'encoding_type' : encoding
75
76
}
76
77
77
78
service = get_service ()
@@ -112,7 +113,7 @@ def analyze_syntax(text, encoding='UTF32'):
112
113
if args .command == 'entities' :
113
114
result = analyze_entities (args .text , get_native_encoding_type ())
114
115
elif args .command == 'sentiment' :
115
- result = analyze_sentiment (args .text )
116
+ result = analyze_sentiment (args .text , get_native_encoding_type () )
116
117
elif args .command == 'syntax' :
117
118
result = analyze_syntax (args .text , get_native_encoding_type ())
118
119
You can’t perform that action at this time.
0 commit comments