sentra 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sentra/version.rb +1 -1
  3. data/lib/sentra.rb +24 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c528c6c68c7f565e175d8fdd361e49236e2cb95
4
- data.tar.gz: a786b7995025e74f12df5d805a28e01192e9a34f
3
+ metadata.gz: dbd6267dd8833e3ddad32875e9c8221410ab9464
4
+ data.tar.gz: e2f9a94c56f22d9b1b94f1b52a03350324554298
5
5
  SHA512:
6
- metadata.gz: 045d7dfa248a6c2e7db198869952ac5f44ac4d4669329cb0d969ae161a09f8af579620264a55fcde720904924dda94ed1d24861abc0ca6ed5fdeb39612caf2aa
7
- data.tar.gz: 080e5484ceab32caea99b00fce44ea2ed4f3858f82605cad51b2c6dcefef9e94aef470dad930ea2c5503174370a42a8c939300014e2a3ef86be42750d79bff71
6
+ metadata.gz: db23e5d59bf4c1d38596478c2ae4d6475aa541c174302649c5496d7e53663a6fae1e408a1b7576f1c36f84a1b5c9d99d85ddded4fe4d5f5f16d4074ccc58b06a
7
+ data.tar.gz: a7144c2687cf54da24963f39408079ab385a371ebd94775706ec74a49f38e59c7a38c01e365e93fcdb43fd846f2f2837bc94a73731fafa6d5d67017c17128f5d
@@ -1,3 +1,3 @@
1
1
  module Sentra
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/sentra.rb CHANGED
@@ -26,7 +26,13 @@ module Sentra
26
26
  end
27
27
 
28
28
 
29
- post '/get_sentiments' do
29
+ get '/get_hello' do
30
+ p "hello"
31
+ "Hello"
32
+ end
33
+
34
+
35
+ post '/sentra/analyzer/atomic' do
30
36
  puts "hello"
31
37
  query = request.body.read.to_s
32
38
  query = JSON.parse(query)
@@ -40,13 +46,28 @@ module Sentra
40
46
  article.setTitle("Ref #1117")
41
47
  article.setChannel('GENERAL')
42
48
  article.setContent(query['content'])
43
- #serializer = ArticleTools::ArticleSerializer.new
49
+ serializer = ArticleTools::ArticleSerializer.new
44
50
  # article = serializer.read_from_xml_string(params[:query])
45
51
  queue = SemanticService::UnixSocketClient.new()
46
52
  queue.writeArticle(article)
47
53
  result = queue.readArticle()
48
54
 
49
- result
55
+
56
+ statistics = result.getMetadata('twitter').getFacts()
57
+
58
+ response = {}
59
+ response['negative'] = statistics[0].getValue.to_f / statistics[3].getValue.to_f
60
+ response['positive'] = statistics[1].getValue.to_f / statistics[3].getValue.to_f
61
+ response['neutral'] = statistics[2].getValue.to_f / statistics[3].getValue.to_f
62
+ response['details'] = {}
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+ response.to_json
50
71
  end
51
72
 
52
73
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kshakirov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-06 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler