gnfinder 0.9.0.1 → 0.15.4

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
  SHA256:
3
- metadata.gz: b96851cdebc9043949a0c68e3c7e2819d85a625726757288ab3c7e1309908fac
4
- data.tar.gz: 2efdd6a4b7bfbb1da91227176e0629997bcda15c64ecf0c4e709ae5d6bda2538
3
+ metadata.gz: b44ef459356568026904e4b42664ab39b3b7cfef043c33e62d95c47f7081ec7b
4
+ data.tar.gz: 5da9930ce9d03c4184b51055a6a17d5d63510246460a742b768b56d940f6f536
5
5
  SHA512:
6
- metadata.gz: 569e08ae23fdd91769d2183f193e8b5c40d4a832d0556d6333b5717f37d4bc9e2be4d9cd9386a958291059313273b24574122c628ecc444fba242a1a806e1166
7
- data.tar.gz: 60d51aa23f0a0f6b03cb7dfb48b974f7e528b3b2f3953b69501014f0e02153ed28a76523baf341ad1cb353b9746802da4957932fd93a0590480c7a87cbef4acc
6
+ metadata.gz: 2d37282d56d4d41d913f74765d86b6ea38ccb8ececcd957a672bf1296fb3dfb5fb50a373fb64f4e0c981cfd658eb884a4eb6179434e82c7b619cd54c8dcf21f0
7
+ data.tar.gz: 27ac046cd874aa9a099d44290d818d61d85282e9bd10f3fb384c37293ace1dd4f50b47f2693ee2220b46c4980535d7a8936b29c01c3ca597cf577ad3ffd0f91a
data/.rubocop.yml CHANGED
@@ -1,10 +1,14 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.6
2
+ NewCops: disable
3
+ TargetRubyVersion: 3.0
3
4
  Exclude:
4
5
  - 'lib/protob_pb.rb'
5
6
  - 'lib/protob_services_pb.rb'
6
7
  Style/StringLiterals:
7
8
  EnforcedStyle: single_quotes
9
+ Metrics/AbcSize:
10
+ Exclude:
11
+ - '**/*'
8
12
  Metrics/BlockLength:
9
13
  Exclude:
10
14
  - 'spec/**/*'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [v0.15.4]
6
+
7
+ - Add [#14]: Compatibility with gnfider v0.15.4, switching to REST API.
8
+
5
9
  ## [v0.2.0]
6
10
 
7
11
  - Compatibility with gnfinder v0.7.0
@@ -29,10 +33,28 @@
29
33
 
30
34
  This document follows [changelog guidelines]
31
35
 
36
+ [v0.15.4]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.0...v0.15.4
37
+ [v0.2.0]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.3...v0.2.0
38
+ [v0.1.3]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.2...v0.1.3
39
+ [v0.1.2]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.1...v0.1.2
32
40
  [v0.1.1]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.0...v0.1.1
33
41
  [v0.1.0]: https://github.com/GlobalNamesArchitecture/gnfinder/tree/v0.1.0
34
42
 
35
- [#6]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/5
43
+ [#20]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/20
44
+ [#19]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/19
45
+ [#18]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/18
46
+ [#17]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/17
47
+ [#16]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/16
48
+ [#15]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/15
49
+ [#14]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/14
50
+ [#13]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/13
51
+ [#12]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/12
52
+ [#11]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/11
53
+ [#10]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/10
54
+ [#9]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/9
55
+ [#8]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/8
56
+ [#7]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/7
57
+ [#6]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/6
36
58
  [#5]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/5
37
59
  [#4]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/4
38
60
  [#3]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/3
data/README.md CHANGED
@@ -159,16 +159,16 @@ res = gf.find_names(txt, verification: true, sources: [1, 4, 179])
159
159
  ### Combination of parameters.
160
160
 
161
161
  It is possible to combine parameters. However if a parameter makes no sense in
162
- a particular context. It is silently ignored.
162
+ a particular context it is silently ignored.
163
163
 
164
164
  ```ruby
165
165
  # Runs Bayes' algorithms using English training set, runs verification and
166
166
  # returns matched results for 3 data-sources if they are available.
167
- res = gf.find_names(txt, language: eng, verification: true,
167
+ res = gf.find_names(txt, language: 'eng', verification: true,
168
168
  sources: [1, 4, 179])
169
169
 
170
170
  # Ignores `sources:` settings, because `with_verification` is not set to `true`
171
- res = gf.find_names(txt, language: eng, sources: [1, 4, 179])
171
+ res = gf.find_names(txt, language: 'eng', sources: [1, 4, 179])
172
172
  ```
173
173
 
174
174
  ## Development
@@ -214,4 +214,4 @@ bundle exec rspec
214
214
  [client]: https://github.com/GlobalNamesArchitecture/gnfinder/blob/master/lib/gnfinder/client.rb
215
215
  [data-source list]: http://index.globalnames.org/datasource
216
216
  [proto file]: https://github.com/GlobalNamesArchitecture/gnfinder/blob/master/lib/protob_pb.rb
217
- [tests]: https://github.com/GlobalNamesArchitecture/gnfinder/blob/master/spec/lib/client_spec.rb
217
+ [tests]: https://github.com/GlobalNamesArchitecture/gnfinder/blob/master/spec/lib/client_spec.rb
data/gnfinder.gemspec CHANGED
@@ -20,12 +20,12 @@ Gem::Specification.new do |gem|
20
20
  .reject { |f| f.match(%r{^(test|spec|features)/}) }
21
21
 
22
22
  gem.require_paths = ['lib']
23
- gem.required_ruby_version = '~> 2.6'
24
- gem.add_development_dependency 'bundler', '~> 2.0'
25
- gem.add_development_dependency 'byebug', '~> 10.0'
26
- gem.add_development_dependency 'grpc', '~> 1.15'
27
- gem.add_development_dependency 'grpc-tools', '~> 1.15'
28
- gem.add_development_dependency 'rake', '~> 12.3'
29
- gem.add_development_dependency 'rspec', '~> 3.8'
30
- gem.add_development_dependency 'rubocop', '~> 0.59'
23
+ gem.required_ruby_version = '~> 3.0'
24
+ gem.add_dependency 'rest-client', '~> 2.1'
25
+ gem.add_development_dependency 'bundler', '~> 2.2'
26
+ gem.add_development_dependency 'byebug', '~> 11.1'
27
+ gem.add_development_dependency 'rake', '~> 13.0'
28
+ gem.add_development_dependency 'rspec', '~> 3.10'
29
+ gem.add_development_dependency 'rubocop', '~> 1.20'
30
+ gem.add_development_dependency 'solargraph', '~> 0.43'
31
31
  end
@@ -1,47 +1,70 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gnfinder
4
- GNFINDER_MIN_VERSION = 'v0.9.0'
5
-
6
4
  # Gnfinder::Client connects to gnfinder server
7
5
  class Client
8
- def initialize(host = '0.0.0.0', port = '8778')
9
- @stub = Protob::GNFinder::Stub.new("#{host}:#{port}",
10
- :this_channel_is_insecure)
11
- return if gnfinder_version.version >= GNFINDER_MIN_VERSION
12
-
13
- raise 'gRPC server of gnfinder should be at least ' \
14
- ' #{GNFINDER_MIN_VERSION}.\n Download latest version from ' \
15
- 'https://github.com/gnames/gnfinder/releases/latest.'
6
+ def initialize(host = 'https://gnfinder.globalnames.org', port = '')
7
+ api_path = '/api/v1'
8
+ url = host + api_path
9
+ url = "#{host}:#{port}#{api_path}" if port.to_s != ''
10
+ @site = RestClient::Resource.new(url, read_timeout: 60)
11
+ @port = port
16
12
  end
17
13
 
18
14
  def gnfinder_version
19
- @stub.ver(Protob::Void.new)
15
+ resp = @site['/version'].get
16
+ ver = JSON.parse(resp.body, symbolize_names: true)
17
+ OpenStruct.new(ver)
20
18
  end
21
19
 
22
20
  def ping
23
- @stub.ping(Protob::Void.new).value
21
+ @site['/ping'].get.body
24
22
  end
25
23
 
26
24
  # rubocop:disable all
27
25
  def find_names(text, opts = {})
28
26
  if text.to_s.strip == ''
29
- return Protob::Output.new
27
+ return to_open_struct({ "names": [] })
30
28
  end
31
29
 
32
30
  params = { text: text }
33
- params[:no_bayes] = true if opts[:no_bayes]
31
+ params[:noBayes] = true if opts[:no_bayes]
32
+ params[:oddsDetails] = true if opts[:odds_details]
34
33
  params[:language] = opts[:language] if opts[:language].to_s.strip != ''
35
- if opts[:detect_language]
36
- params[:detect_language] = opts[:detect_language]
34
+
35
+ if opts[:words_around] && opts[:words_around] > 0
36
+ params[:wordsAround] = opts[:words_around]
37
37
  end
38
+
38
39
  params[:verification] = true if opts[:verification]
40
+
39
41
  if opts[:sources] && !opts[:sources].empty?
40
42
  params[:sources] = opts[:sources]
41
43
  end
42
44
 
43
- @stub.find_names(Protob::Params.new(params))
45
+ res = @site['find'].post params.to_json, {content_type: :json, accept: :json}
46
+ output = JSON.parse(res.body)
47
+ res = output["metadata"]
48
+ res["names"] = output["names"] || []
49
+ res = res.deep_transform_keys(&:underscore)
50
+ if res["names"].nil?
51
+ res["names"] = []
52
+ end
53
+ to_open_struct(res)
44
54
  end
45
55
  # rubocop:enable all
56
+
57
+ private
58
+
59
+ def to_open_struct(obj)
60
+ case obj
61
+ when Hash
62
+ OpenStruct.new(obj.transform_values { |val| to_open_struct(val) })
63
+ when Array
64
+ obj.map { |o| to_open_struct(o) }
65
+ else # Assumed to be a primitive value
66
+ obj
67
+ end
68
+ end
46
69
  end
47
70
  end
@@ -3,7 +3,7 @@
3
3
  # Gnfinder is a namespace module for gndinfer gem.
4
4
  module Gnfinder
5
5
  # Version corresponds to the minimal supported version of Go gnfinder
6
- VERSION = '0.9.0.1'
6
+ VERSION = '0.15.4'
7
7
 
8
8
  def self.version
9
9
  VERSION
data/lib/gnfinder.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'rest-client'
4
+ require 'json'
5
+ require_relative 'hash'
3
6
  require_relative 'gnfinder/version'
4
- require_relative 'protob_pb.rb'
5
- require_relative 'protob_services_pb.rb'
6
7
  require_relative 'gnfinder/client'
7
8
 
8
9
  # Gnfinder is a namespace module for gndinfer gem.
data/lib/hash.rb ADDED
@@ -0,0 +1,170 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Monkey patch for underscores.
4
+ class String
5
+ def underscore
6
+ gsub(/::/, '/')
7
+ .gsub(/([a-z\d])([A-Z])/) do
8
+ "#{Regexp.last_match(1)}_#{Regexp.last_match(2)}"
9
+ end
10
+ .downcase
11
+ end
12
+ end
13
+
14
+ # Hash monkey patches from ActiveSupport
15
+ class Hash
16
+ # Returns a new hash with all keys converted to strings.
17
+ #
18
+ # hash = { name: 'Rob', age: '28' }
19
+ #
20
+ # hash.stringify_keys
21
+ # # => {"name"=>"Rob", "age"=>"28"}
22
+ def stringify_keys
23
+ transform_keys(&:to_s)
24
+ end
25
+
26
+ # Destructively converts all keys to strings. Same as
27
+ # +stringify_keys+, but modifies +self+.
28
+ def stringify_keys!
29
+ transform_keys!(&:to_s)
30
+ end
31
+
32
+ # Returns a new hash with all keys converted to symbols, as long as
33
+ # they respond to +to_sym+.
34
+ #
35
+ # hash = { 'name' => 'Rob', 'age' => '28' }
36
+ #
37
+ # hash.symbolize_keys
38
+ # # => {:name=>"Rob", :age=>"28"}
39
+ def symbolize_keys
40
+ transform_keys do |key|
41
+ key.to_sym
42
+ rescue StandardError
43
+ key
44
+ end
45
+ end
46
+ alias to_options symbolize_keys
47
+
48
+ # Destructively converts all keys to symbols, as long as they respond
49
+ # to +to_sym+. Same as +symbolize_keys+, but modifies +self+.
50
+ def symbolize_keys!
51
+ transform_keys! do |key|
52
+ key.to_sym
53
+ rescue StandardError
54
+ key
55
+ end
56
+ end
57
+ alias to_options! symbolize_keys!
58
+
59
+ # Validates all keys in a hash match <tt>*valid_keys</tt>, raising
60
+ # +ArgumentError+ on a mismatch.
61
+ #
62
+ # Note that keys are treated differently than HashWithIndifferentAccess,
63
+ # meaning that string and symbol keys will not match.
64
+ def assert_valid_keys(*valid_keys)
65
+ valid_keys.flatten!
66
+ each_key do |k|
67
+ unless valid_keys.include?(k)
68
+ raise ArgumentError, "Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}"
69
+ end
70
+ end
71
+ end
72
+
73
+ # Returns a new hash with all keys converted by the block operation.
74
+ # This includes the keys from the root hash and from all
75
+ # nested hashes and arrays.
76
+ #
77
+ # hash = { person: { name: 'Rob', age: '28' } }
78
+ #
79
+ # hash.deep_transform_keys{ |key| key.to_s.upcase }
80
+ # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}}
81
+ def deep_transform_keys(&block)
82
+ _deep_transform_keys_in_object(self, &block)
83
+ end
84
+
85
+ # Destructively converts all keys by using the block operation.
86
+ # This includes the keys from the root hash and from all
87
+ # nested hashes and arrays.
88
+ def deep_transform_keys!(&block)
89
+ _deep_transform_keys_in_object!(self, &block)
90
+ end
91
+
92
+ # Returns a new hash with all keys converted to strings.
93
+ # This includes the keys from the root hash and from all
94
+ # nested hashes and arrays.
95
+ #
96
+ # hash = { person: { name: 'Rob', age: '28' } }
97
+ #
98
+ # hash.deep_stringify_keys
99
+ # # => {"person"=>{"name"=>"Rob", "age"=>"28"}}
100
+ def deep_stringify_keys
101
+ deep_transform_keys(&:to_s)
102
+ end
103
+
104
+ # Destructively converts all keys to strings.
105
+ # This includes the keys from the root hash and from all
106
+ # nested hashes and arrays.
107
+ def deep_stringify_keys!
108
+ deep_transform_keys!(&:to_s)
109
+ end
110
+
111
+ # Returns a new hash with all keys converted to symbols, as long as
112
+ # they respond to +to_sym+. This includes the keys from the root hash
113
+ # and from all nested hashes and arrays.
114
+ #
115
+ # hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } }
116
+ #
117
+ # hash.deep_symbolize_keys
118
+ # # => {:person=>{:name=>"Rob", :age=>"28"}}
119
+ def deep_symbolize_keys
120
+ deep_transform_keys do |key|
121
+ key.to_sym
122
+ rescue StandardError
123
+ key
124
+ end
125
+ end
126
+
127
+ # Destructively converts all keys to symbols, as long as they respond
128
+ # to +to_sym+. This includes the keys from the root hash and from all
129
+ # nested hashes and arrays.
130
+ def deep_symbolize_keys!
131
+ deep_transform_keys! do |key|
132
+ key.to_sym
133
+ rescue StandardError
134
+ key
135
+ end
136
+ end
137
+
138
+ private
139
+
140
+ # Support methods for deep transforming nested hashes and arrays.
141
+ def _deep_transform_keys_in_object(object, &block)
142
+ case object
143
+ when Hash
144
+ object.each_with_object(self.class.new) do |(key, value), result|
145
+ result[yield(key)] = _deep_transform_keys_in_object(value, &block)
146
+ end
147
+ when Array
148
+ object.map { |e| _deep_transform_keys_in_object(e, &block) }
149
+ else
150
+ object
151
+ end
152
+ end
153
+
154
+ # rubocop:disable all
155
+ def _deep_transform_keys_in_object!(object, &block)
156
+ case object
157
+ when Hash
158
+ object.each_key do |key|
159
+ value = object.delete(key)
160
+ object[yield(key)] = _deep_transform_keys_in_object!(value, &block)
161
+ end
162
+ object
163
+ when Array
164
+ object.map! { |e| _deep_transform_keys_in_object!(e, &block) }
165
+ else
166
+ object
167
+ end
168
+ end
169
+ # rubocop:enable all
170
+ end
metadata CHANGED
@@ -1,113 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnfinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.1
4
+ version: 0.15.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-03 00:00:00.000000000 Z
11
+ date: 2021-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: rest-client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :development
19
+ version: '2.1'
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: byebug
28
+ name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '2.2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '2.2'
41
41
  - !ruby/object:Gem::Dependency
42
- name: grpc
42
+ name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.15'
47
+ version: '11.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.15'
54
+ version: '11.1'
55
55
  - !ruby/object:Gem::Dependency
56
- name: grpc-tools
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.15'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.15'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '12.3'
75
+ version: '3.10'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '12.3'
82
+ version: '3.10'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec
84
+ name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.8'
89
+ version: '1.20'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.8'
96
+ version: '1.20'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop
98
+ name: solargraph
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0.59'
103
+ version: '0.43'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0.59'
110
+ version: '0.43'
111
111
  description: |-
112
112
  The gem searches for scientific names in texts using
113
113
  gRPC server running gnfinder app written in Go language
@@ -128,13 +128,12 @@ files:
128
128
  - lib/gnfinder.rb
129
129
  - lib/gnfinder/client.rb
130
130
  - lib/gnfinder/version.rb
131
- - lib/protob_pb.rb
132
- - lib/protob_services_pb.rb
131
+ - lib/hash.rb
133
132
  homepage: http://github.com/GlobalNamesArchitecture/gnfinder
134
133
  licenses:
135
134
  - MIT
136
135
  metadata: {}
137
- post_install_message:
136
+ post_install_message:
138
137
  rdoc_options: []
139
138
  require_paths:
140
139
  - lib
@@ -142,15 +141,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
141
  requirements:
143
142
  - - "~>"
144
143
  - !ruby/object:Gem::Version
145
- version: '2.6'
144
+ version: '3.0'
146
145
  required_rubygems_version: !ruby/object:Gem::Requirement
147
146
  requirements:
148
147
  - - ">="
149
148
  - !ruby/object:Gem::Version
150
149
  version: '0'
151
150
  requirements: []
152
- rubygems_version: 3.0.3
153
- signing_key:
151
+ rubygems_version: 3.2.22
152
+ signing_key:
154
153
  specification_version: 4
155
154
  summary: Scientific names finder
156
155
  test_files: []
data/lib/protob_pb.rb DELETED
@@ -1,88 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: protob.proto
3
-
4
- require 'google/protobuf'
5
-
6
- Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_file("protob.proto", :syntax => :proto3) do
8
- add_message "protob.Void" do
9
- end
10
- add_message "protob.Pong" do
11
- optional :value, :string, 1
12
- end
13
- add_message "protob.Version" do
14
- optional :version, :string, 1
15
- optional :build, :string, 2
16
- end
17
- add_message "protob.Params" do
18
- optional :text, :string, 1
19
- optional :no_bayes, :bool, 3
20
- optional :language, :string, 4
21
- optional :detect_language, :bool, 5
22
- optional :verification, :bool, 6
23
- repeated :sources, :int32, 7
24
- end
25
- add_message "protob.Output" do
26
- optional :date, :string, 1
27
- optional :finder_version, :string, 2
28
- optional :language, :string, 3
29
- optional :language_detected, :string, 4
30
- optional :detect_language, :bool, 5
31
- optional :total_tokens, :int32, 6
32
- optional :total_candidates, :int32, 7
33
- optional :total_names, :int32, 8
34
- repeated :names, :message, 9, "protob.NameString"
35
- end
36
- add_message "protob.NameString" do
37
- optional :type, :string, 1
38
- optional :verbatim, :string, 2
39
- optional :name, :string, 3
40
- optional :odds, :float, 4
41
- optional :offset_start, :int32, 5
42
- optional :offset_end, :int32, 6
43
- optional :verification, :message, 7, "protob.Verification"
44
- end
45
- add_message "protob.Verification" do
46
- optional :best_result, :message, 1, "protob.ResultData"
47
- repeated :preferred_results, :message, 2, "protob.ResultData"
48
- optional :data_sources_num, :int32, 3
49
- optional :data_source_quality, :string, 4
50
- optional :retries, :int32, 5
51
- optional :error, :string, 6
52
- end
53
- add_message "protob.ResultData" do
54
- optional :data_source_id, :int32, 1
55
- optional :data_source_title, :string, 2
56
- optional :taxon_id, :string, 3
57
- optional :matched_name, :string, 4
58
- optional :matched_canonical, :string, 5
59
- optional :current_name, :string, 6
60
- optional :synonym, :bool, 7
61
- optional :classification_path, :string, 8
62
- optional :classification_rank, :string, 9
63
- optional :classification_ids, :string, 10
64
- optional :edit_distance, :int32, 11
65
- optional :stem_edit_distance, :int32, 12
66
- optional :match_type, :enum, 13, "protob.MatchType"
67
- end
68
- add_enum "protob.MatchType" do
69
- value :NONE, 0
70
- value :EXACT, 1
71
- value :FUZZY, 2
72
- value :PARTIAL_EXACT, 3
73
- value :PARTIAL_FUZZY, 4
74
- end
75
- end
76
- end
77
-
78
- module Protob
79
- Void = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Void").msgclass
80
- Pong = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Pong").msgclass
81
- Version = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Version").msgclass
82
- Params = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Params").msgclass
83
- Output = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Output").msgclass
84
- NameString = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.NameString").msgclass
85
- Verification = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Verification").msgclass
86
- ResultData = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.ResultData").msgclass
87
- MatchType = Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.MatchType").enummodule
88
- end
@@ -1,24 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: protob.proto for package 'protob'
3
-
4
- require 'grpc'
5
- require 'protob_pb'
6
-
7
- module Protob
8
- module GNFinder
9
- class Service
10
-
11
- include GRPC::GenericService
12
-
13
- self.marshal_class_method = :encode
14
- self.unmarshal_class_method = :decode
15
- self.service_name = 'protob.GNFinder'
16
-
17
- rpc :Ping, Void, Pong
18
- rpc :Ver, Void, Version
19
- rpc :FindNames, Params, Output
20
- end
21
-
22
- Stub = Service.rpc_stub_class
23
- end
24
- end