indico 0.9.4 → 0.9.5
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.
- data/lib/indico.rb +18 -5
- data/lib/indico/version.rb +1 -1
- data/spec/indico_batch_spec.rb +2 -2
- data/spec/indico_spec.rb +8 -2
- metadata +23 -11
- checksums.yaml +0 -7
data/lib/indico.rb
CHANGED
@@ -102,15 +102,24 @@ module Indico
|
|
102
102
|
return api_handler(text, 'textfeatures', config)
|
103
103
|
end
|
104
104
|
|
105
|
-
def self.people(text, config =
|
105
|
+
def self.people(text, config = {})
|
106
|
+
if not (config.key?('v') or config.key?('version'))
|
107
|
+
config['version'] = "2"
|
108
|
+
end
|
106
109
|
api_handler(text, "people", config)
|
107
110
|
end
|
108
111
|
|
109
|
-
def self.organizations(text, config =
|
112
|
+
def self.organizations(text, config = {})
|
113
|
+
if not (config.key?('v') or config.key?('version'))
|
114
|
+
config['version'] = "2"
|
115
|
+
end
|
110
116
|
api_handler(text, "organizations", config)
|
111
117
|
end
|
112
118
|
|
113
|
-
def self.places(text, config =
|
119
|
+
def self.places(text, config = {})
|
120
|
+
if not (config.key?('v') or config.key?('version'))
|
121
|
+
config['version'] = "2"
|
122
|
+
end
|
114
123
|
api_handler(text, "places", config)
|
115
124
|
end
|
116
125
|
|
@@ -182,8 +191,10 @@ module Indico
|
|
182
191
|
if config.nil?
|
183
192
|
config = Hash.new()
|
184
193
|
end
|
194
|
+
if @domain
|
195
|
+
config[:domain] = @domain
|
196
|
+
end
|
185
197
|
config[:collection] = @collection
|
186
|
-
config[:domain] = @domain || config["domain"]
|
187
198
|
Indico.api_handler(data, 'custom', config, 'add_data')
|
188
199
|
end
|
189
200
|
|
@@ -222,7 +233,9 @@ module Indico
|
|
222
233
|
config = Hash.new()
|
223
234
|
end
|
224
235
|
config[:collection] = @collection
|
225
|
-
|
236
|
+
if @domain
|
237
|
+
config[:domain] = @domain
|
238
|
+
end
|
226
239
|
Indico.api_handler(data, 'custom', config, 'predict')
|
227
240
|
end
|
228
241
|
|
data/lib/indico/version.rb
CHANGED
data/spec/indico_batch_spec.rb
CHANGED
@@ -57,11 +57,11 @@ describe Indico do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'should return people found in the text provided' do
|
60
|
-
text = ["
|
60
|
+
text = ["Bill Gates, founder of Microsoft, can jump over a chair from standing position"]
|
61
61
|
text += text
|
62
62
|
result = Indico.people(text)
|
63
63
|
result[0] = result[0].sort_by { |k| -k["confidence"] }
|
64
|
-
expect result[0][0]["text"].include? "
|
64
|
+
expect result[0][0]["text"].include? "Bill Gates"
|
65
65
|
expect result.length == 2
|
66
66
|
end
|
67
67
|
|
data/spec/indico_spec.rb
CHANGED
@@ -150,21 +150,27 @@ describe Indico do
|
|
150
150
|
end
|
151
151
|
|
152
152
|
it 'should return people found in the text provided' do
|
153
|
-
text = "
|
153
|
+
text = "Bill Gates, founder of Microsoft, can jump over a chair from standing position"
|
154
154
|
result = Indico.people(text).sort_by { |k| -k["confidence"] }
|
155
|
-
|
155
|
+
v1_result = Indico.people(text, config={version: "2"}).sort_by { |k| -k["confidence"] }
|
156
|
+
expect result[0]["text"].include? "Bill Gates"
|
157
|
+
expect result[0]["confidence"] != v1_result[0]["confidence"]
|
156
158
|
end
|
157
159
|
|
158
160
|
it 'should return organizations found in the text provided' do
|
159
161
|
text = "Chinese internet giant Alibaba is to buy Hong Kong-based newspaper the South China Morning Post (SCMP)."
|
160
162
|
result = Indico.organizations(text).sort_by { |k| -k["confidence"] }
|
161
163
|
expect result[0]["text"].include? "Alibaba"
|
164
|
+
v1_result = Indico.organizations(text, config={version: "2"}).sort_by { |k| -k["confidence"] }
|
165
|
+
expect result[0]["confidence"] != v1_result[0]["confidence"]
|
162
166
|
end
|
163
167
|
|
164
168
|
it 'should return places found in the text provided' do
|
165
169
|
text = "Alibaba to buy Hong Kong's South China Morning Post"
|
166
170
|
result = Indico.places(text).sort_by { |k| -k["confidence"] }
|
167
171
|
expect result[0]["text"].include? "China"
|
172
|
+
v1_result = Indico.places(text, config={version: "2"}).sort_by { |k| -k["confidence"] }
|
173
|
+
expect result[0]["confidence"] != v1_result[0]["confidence"]
|
168
174
|
end
|
169
175
|
|
170
176
|
it 'should tag face with correct facial expression' do
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: indico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Slater Victoroff
|
@@ -11,11 +12,12 @@ authors:
|
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date: 2016-06-
|
15
|
+
date: 2016-06-29 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: inifile
|
18
19
|
requirement: !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
19
21
|
requirements:
|
20
22
|
- - ~>
|
21
23
|
- !ruby/object:Gem::Version
|
@@ -23,6 +25,7 @@ dependencies:
|
|
23
25
|
type: :runtime
|
24
26
|
prerelease: false
|
25
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
26
29
|
requirements:
|
27
30
|
- - ~>
|
28
31
|
- !ruby/object:Gem::Version
|
@@ -30,6 +33,7 @@ dependencies:
|
|
30
33
|
- !ruby/object:Gem::Dependency
|
31
34
|
name: oily_png
|
32
35
|
requirement: !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
33
37
|
requirements:
|
34
38
|
- - ~>
|
35
39
|
- !ruby/object:Gem::Version
|
@@ -37,6 +41,7 @@ dependencies:
|
|
37
41
|
type: :runtime
|
38
42
|
prerelease: false
|
39
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
40
45
|
requirements:
|
41
46
|
- - ~>
|
42
47
|
- !ruby/object:Gem::Version
|
@@ -44,6 +49,7 @@ dependencies:
|
|
44
49
|
- !ruby/object:Gem::Dependency
|
45
50
|
name: bundler
|
46
51
|
requirement: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
47
53
|
requirements:
|
48
54
|
- - ~>
|
49
55
|
- !ruby/object:Gem::Version
|
@@ -51,6 +57,7 @@ dependencies:
|
|
51
57
|
type: :development
|
52
58
|
prerelease: false
|
53
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
54
61
|
requirements:
|
55
62
|
- - ~>
|
56
63
|
- !ruby/object:Gem::Version
|
@@ -58,29 +65,33 @@ dependencies:
|
|
58
65
|
- !ruby/object:Gem::Dependency
|
59
66
|
name: rake
|
60
67
|
requirement: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
61
69
|
requirements:
|
62
|
-
- - '>='
|
70
|
+
- - ! '>='
|
63
71
|
- !ruby/object:Gem::Version
|
64
72
|
version: '0'
|
65
73
|
type: :development
|
66
74
|
prerelease: false
|
67
75
|
version_requirements: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
68
77
|
requirements:
|
69
|
-
- - '>='
|
78
|
+
- - ! '>='
|
70
79
|
- !ruby/object:Gem::Version
|
71
80
|
version: '0'
|
72
81
|
- !ruby/object:Gem::Dependency
|
73
82
|
name: rspec
|
74
83
|
requirement: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
75
85
|
requirements:
|
76
|
-
- - '>='
|
86
|
+
- - ! '>='
|
77
87
|
- !ruby/object:Gem::Version
|
78
88
|
version: '0'
|
79
89
|
type: :development
|
80
90
|
prerelease: false
|
81
91
|
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
82
93
|
requirements:
|
83
|
-
- - '>='
|
94
|
+
- - ! '>='
|
84
95
|
- !ruby/object:Gem::Version
|
85
96
|
version: '0'
|
86
97
|
description: A simple Ruby Wrapper for the indico set of APIs.
|
@@ -125,25 +136,26 @@ files:
|
|
125
136
|
homepage: https://github.com/IndicoDataSolutions/IndicoIo-ruby
|
126
137
|
licenses:
|
127
138
|
- MIT
|
128
|
-
metadata: {}
|
129
139
|
post_install_message:
|
130
140
|
rdoc_options: []
|
131
141
|
require_paths:
|
132
142
|
- lib
|
133
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
none: false
|
134
145
|
requirements:
|
135
|
-
- - '>='
|
146
|
+
- - ! '>='
|
136
147
|
- !ruby/object:Gem::Version
|
137
148
|
version: '0'
|
138
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
139
151
|
requirements:
|
140
|
-
- - '>='
|
152
|
+
- - ! '>='
|
141
153
|
- !ruby/object:Gem::Version
|
142
154
|
version: '0'
|
143
155
|
requirements: []
|
144
156
|
rubyforge_project:
|
145
|
-
rubygems_version:
|
157
|
+
rubygems_version: 1.8.23
|
146
158
|
signing_key:
|
147
|
-
specification_version:
|
159
|
+
specification_version: 3
|
148
160
|
summary: A simple Ruby Wrapper for the indico set of APIs.
|
149
161
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: a07e355897fb68aed8c2fc6b2cf73a52a315360a
|
4
|
-
data.tar.gz: 5dc85c207c80641e80fdad1aa9ce4f02500a52d3
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: a8f30adba9ff040c18ea09f6078a5a39b4b6e3711ac585af7fc0eea701762623c16f192d0f4aec6472328cffb1987c3f5ca540f8d69c24c85ce40aabae80293c
|
7
|
-
data.tar.gz: afa96e01d407b2a7f6d32fa22816b1282394e31be44e3684b474a949116534d90cd2600a6bfa0a2165b8dcc645382e36232bb208a6db07647bd6a986078f4b39
|