indico 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/indico/helper.rb CHANGED
@@ -30,8 +30,8 @@ module Indico
30
30
  unless config.nil?
31
31
  server = config.delete('cloud')
32
32
  api_key = config.delete('api_key')
33
- apis = config.delete(:apis)
34
- version = config.delete(:version)
33
+ apis = config.delete('apis')
34
+ version = config.delete('version')
35
35
  d = d.merge(config)
36
36
  end
37
37
 
data/lib/indico/multi.rb CHANGED
@@ -37,7 +37,7 @@ module Indico
37
37
  end
38
38
 
39
39
  self.validate_apis(apis, type, allowed)
40
- config[:apis] = apis
40
+ config['apis'] = apis
41
41
  response = api_handler(data, batch ? "apis/batch" : "apis", config)
42
42
  return handle_multi(response)
43
43
  end
@@ -63,7 +63,7 @@ module Indico
63
63
  end
64
64
 
65
65
  self.validate_apis(apis)
66
- config[:apis] = apis
66
+ config['apis'] = apis
67
67
  response = api_handler(data, "apis/intersections", config)
68
68
  return response
69
69
 
@@ -1,3 +1,3 @@
1
1
  module Indico
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
data/lib/indico.rb CHANGED
@@ -67,10 +67,10 @@ module Indico
67
67
 
68
68
  def self.keywords(text, config = nil)
69
69
  unless !config or config.key?(:v) or config.key?(:version)
70
- config[:version] = "2"
70
+ config['version'] = "2"
71
71
  end
72
72
  if config and config.key?(:language) and config[:language] != "english"
73
- config[:version] = "1"
73
+ config['version'] = "1"
74
74
  end
75
75
  api_handler(text, 'keywords', config)
76
76
 
@@ -85,10 +85,15 @@ module Indico
85
85
  config = Hash.new()
86
86
  end
87
87
  config[:queries] = queries
88
+ config[:synonyms] = false
88
89
  return api_handler(text, 'relevance', config)
89
90
  end
90
91
 
91
92
  def self.text_features(text, config = nil)
93
+ if config.nil?
94
+ config = Hash.new()
95
+ end
96
+ config[:synonyms] = false
92
97
  return api_handler(text, 'textfeatures', config)
93
98
  end
94
99
 
@@ -118,8 +123,8 @@ module Indico
118
123
  end
119
124
 
120
125
  def self.image_features(image, config = {})
121
- unless config.key?(:v) or config.key?(:version)
122
- config[:version] = "3"
126
+ unless config.key?('v') or config.key?('version')
127
+ config['version'] = "3"
123
128
  end
124
129
  api_handler(preprocess(image, 512, true), 'imagefeatures', config)
125
130
  end
@@ -134,12 +139,12 @@ module Indico
134
139
  end
135
140
 
136
141
  def self.analyze_image(face, apis = IMAGE_APIS, config = nil)
137
- api_hash = {apis:apis}
142
+ api_hash = {'apis' => apis}
138
143
  multi(preprocess(face, 48, false), "image", apis, IMAGE_APIS, config ? config.update(api_hash) : api_hash)
139
144
  end
140
145
 
141
146
  def self.analyze_text(text, apis = TEXT_APIS, config = nil)
142
- api_hash = {apis:apis}
147
+ api_hash = {'apis' => apis}
143
148
  multi(text, "text", apis, TEXT_APIS, config ? config.update(api_hash) : api_hash)
144
149
  end
145
150
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: indico
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-03-28 00:00:00.000000000 Z
15
+ date: 2016-03-31 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: inifile