37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/sentra/sents.rb', line 37
def process_result statistics
response = {}
if statistics[3].getValue.to_f > 0
response['negative'] = statistics[0].getValue.to_f / statistics[3].getValue.to_f
response['positive'] = statistics[1].getValue.to_f / statistics[3].getValue.to_f
response['neutral'] = statistics[2].getValue.to_f / statistics[3].getValue.to_f
else
response['negative'] = 0
response['positive'] = 0
response['neutral'] = 1
end
response['details'] = {}
response
end
|