sentra 0.1.9 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 241a9c6f287995d1654cbdc7e60cf34f0d071ee3
4
- data.tar.gz: a896e4a0c5268d24eab362e0a8f1b1849cc900bf
3
+ metadata.gz: 1c193f60f03deb274a90ec981273219fdc163dd1
4
+ data.tar.gz: f339043744f90bda9610f2352f30edb96003ec34
5
5
  SHA512:
6
- metadata.gz: 5bd42236077beb9ed6e3da207fbd00a5a5890afd9fc8a745e7e8acd846817d20207ca51b755b0814366c81b7984e6afcc00d133b634c3319834f42edb1859b02
7
- data.tar.gz: 752fe0cadf75195e46b08f13d9f8ecb2b49f1176114cf71394ce87200e149552bf717ee278ca77edc0319388d215a104e9ad2e25b09fa549fe9ef8c78f1e1c40
6
+ metadata.gz: 98e897c0e10ec07563fca736e742e66c3355e0064eff1c992babc639dc28a0953c1b17a0dead795b42734d2f436d15accdc0a8930d90306db7791a1abd0f5ceb
7
+ data.tar.gz: 2095052828d840c40ef4b9edaa88ec504f229a58dfe9e90f475f383213c8d15337579437240eca2f4d8f2414802e1ba5f14069b8ac3d72088bac40f95e9a9373
data/lib/sentra/sents.rb CHANGED
@@ -39,7 +39,7 @@ module Sentra
39
39
  else
40
40
  response['negative'] = 0
41
41
  response['positive'] = 0
42
- response['neutral'] = 0
42
+ response['neutral'] = 1
43
43
 
44
44
  end
45
45
  response['details'] = {}
@@ -1,3 +1,3 @@
1
1
  module Sentra
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/sentra.rb CHANGED
@@ -35,14 +35,11 @@ module Sentra
35
35
  begin
36
36
  query = JSON.parse(query)
37
37
  rescue Exception => e
38
- puts 'Error with JSON'
39
- p query
40
- p e.message
38
+ puts e.message
41
39
  query = {}
42
40
  query['content'] = nil
43
41
  end
44
42
  if params['key'] and params['key'] =="QD3F7Yr2u098RfaB" and query['content']
45
- p 'new'
46
43
  processing_client = Sentra::ProcessingClient.new
47
44
  processing_client.prepare_article query['content'],
48
45
  "http://" +SecureRandom.urlsafe_base64 + ".com/" + SecureRandom.urlsafe_base64,
@@ -52,7 +49,6 @@ module Sentra
52
49
  processing_client.process_result(response).to_json
53
50
  rescue Exception => e
54
51
  puts e.message
55
- p response
56
52
  response = {'error' => e.message}
57
53
  response.to_json
58
54
  end
@@ -71,8 +67,6 @@ module Sentra
71
67
  query = JSON.parse(query)
72
68
  rescue Exception => e
73
69
  puts 'Error with JSON'
74
- p query
75
- p e.message
76
70
  query = nil
77
71
  end
78
72
  if params['key'] and params['key'] =="QD3F7Yr2u098RfaB" and query
@@ -93,8 +87,6 @@ module Sentra
93
87
  responses.to_json
94
88
  rescue Exception => e
95
89
  puts 'Errors with converting result to json'
96
- p responses
97
- p e.message
98
90
  end
99
91
  elsif params['key'] and params['key'] =="QD3F7Yr2u098RfaB" and not query and not query['content']
100
92
  return "There is no text to process"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kshakirov