gnfinder 0.11.0 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +41 -0
- data/CHANGELOG.md +27 -1
- data/README.md +74 -52
- data/Rakefile +1 -10
- data/gnfinder.gemspec +8 -6
- data/lib/gnfinder/client.rb +68 -38
- data/lib/gnfinder/version.rb +1 -1
- data/lib/gnfinder.rb +3 -2
- data/lib/hash.rb +170 -0
- metadata +62 -31
- data/lib/protob_pb.rb +0 -112
- data/lib/protob_services_pb.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac89d96503cd4b2030ab6a681e97201959b3acb46035c36b5af6524ee8ef725b
|
4
|
+
data.tar.gz: ce28eb276f6ce689210c16c43aa162ef4f35715eae46453779b176893394822f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d95363b28362959633773ec570217b1b9824a140e1c7000196de791adc88b191fceaf190b5e7384f4ea7b3c57949f1879306a17c9ca85cf4e647ed90d055599c
|
7
|
+
data.tar.gz: b32921b2b52d449ebb8582acca511fd5d9acdf6f10898a75b7357af535f34160dd8c13e2883e03a53a0a56dd9ea2132f1408f30e4474d9495f28b41fe262a3d1
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ${{ matrix.os }}
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
23
|
+
ruby: [2.6, 2.7, 3.0]
|
24
|
+
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
- name: Set up Ruby
|
28
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
29
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
30
|
+
# uses: ruby/setup-ruby@v1
|
31
|
+
uses: ruby/setup-ruby@fdcfbcf14ec9672f6f615cb9589a1bc5dd69d262
|
32
|
+
with:
|
33
|
+
ruby-version: ${{ matrix.ruby }}
|
34
|
+
- name: Install dependencies
|
35
|
+
run: bundle install
|
36
|
+
- name: Show environment
|
37
|
+
run: gem environment
|
38
|
+
- name: Run tests
|
39
|
+
run: bundle exec rake
|
40
|
+
- name: Checking install works
|
41
|
+
run: rake install
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## [v0.15.5]
|
6
|
+
|
7
|
+
- Add [#16]: Search names using URL.
|
8
|
+
|
9
|
+
## [v0.15.4]
|
10
|
+
|
11
|
+
- Add [#14]: Compatibility with gnfider v0.15.4, switching to REST API.
|
12
|
+
|
5
13
|
## [v0.2.0]
|
6
14
|
|
7
15
|
- Compatibility with gnfinder v0.7.0
|
@@ -29,10 +37,28 @@
|
|
29
37
|
|
30
38
|
This document follows [changelog guidelines]
|
31
39
|
|
40
|
+
[v0.15.4]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.0...v0.15.4
|
41
|
+
[v0.2.0]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.3...v0.2.0
|
42
|
+
[v0.1.3]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.2...v0.1.3
|
43
|
+
[v0.1.2]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.1...v0.1.2
|
32
44
|
[v0.1.1]: https://github.com/GlobalNamesArchitecture/gnfinder/compare/v0.1.0...v0.1.1
|
33
45
|
[v0.1.0]: https://github.com/GlobalNamesArchitecture/gnfinder/tree/v0.1.0
|
34
46
|
|
35
|
-
[#
|
47
|
+
[#20]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/20
|
48
|
+
[#19]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/19
|
49
|
+
[#18]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/18
|
50
|
+
[#17]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/17
|
51
|
+
[#16]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/16
|
52
|
+
[#15]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/15
|
53
|
+
[#14]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/14
|
54
|
+
[#13]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/13
|
55
|
+
[#12]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/12
|
56
|
+
[#11]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/11
|
57
|
+
[#10]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/10
|
58
|
+
[#9]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/9
|
59
|
+
[#8]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/8
|
60
|
+
[#7]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/7
|
61
|
+
[#6]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/6
|
36
62
|
[#5]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/5
|
37
63
|
[#4]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/4
|
38
64
|
[#3]: https://github.com/GlobalNamesArchitecture/gnfinder/issues/3
|
data/README.md
CHANGED
@@ -1,43 +1,49 @@
|
|
1
1
|
# gnfinder
|
2
2
|
|
3
|
-
Ruby gem to access functionality of [
|
4
|
-
allows to perform fast and accurate scientific name finding in
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
Ruby gem to access functionality of [GNfinder] project written in Go. This gem
|
4
|
+
allows to perform fast and accurate scientific name finding in texts,
|
5
|
+
web-pages, as well as a large variety of documents. Document files can be
|
6
|
+
accessed either locally or via a URL.
|
7
|
+
|
8
|
+
|
9
|
+
<!-- vim-markdown-toc GFM -->
|
10
|
+
|
11
|
+
* [Requirements](#requirements)
|
12
|
+
* [Installation](#installation)
|
13
|
+
* [Usage](#usage)
|
14
|
+
* [Finding names in a text using default settings](#finding-names-in-a-text-using-default-settings)
|
15
|
+
* [Finding names by a URL](#finding-names-by-a-url)
|
16
|
+
* [Finding names in a file](#finding-names-in-a-file)
|
17
|
+
* [Optionally disable Bayes search](#optionally-disable-bayes-search)
|
18
|
+
* [Set a language for the text](#set-a-language-for-the-text)
|
19
|
+
* [Set automatic detection of text's language](#set-automatic-detection-of-texts-language)
|
20
|
+
* [Set verification option](#set-verification-option)
|
21
|
+
* [Set preferred data-sources list](#set-preferred-data-sources-list)
|
22
|
+
* [Combination of parameters.](#combination-of-parameters)
|
23
|
+
* [Development](#development)
|
24
|
+
|
25
|
+
<!-- vim-markdown-toc -->
|
19
26
|
|
20
27
|
## Requirements
|
21
28
|
|
22
|
-
This gem uses
|
23
|
-
to run it in [
|
29
|
+
This gem uses REST API to access a running [GNfinder] server. You can find how
|
30
|
+
to run it in [GNfinder] README file. By default it uses
|
31
|
+
`https://gnfinder.globalnames.org/api/v1`
|
24
32
|
|
25
33
|
## Installation
|
26
34
|
|
27
|
-
To use the gem from Ruby proect install it using Gemfile, or manually:
|
28
|
-
|
29
35
|
```bash
|
30
36
|
gem install gnfinder
|
31
37
|
```
|
32
38
|
|
33
39
|
## Usage
|
34
40
|
|
35
|
-
The purpose of this gem is to access [
|
41
|
+
The purpose of this gem is to access [GNfinder] functionality from Ruby
|
36
42
|
applications. If you need to find names using other languages, use the
|
37
43
|
[source code][client] of this gem for reference. For other usages read
|
38
|
-
the original Go-lang [
|
44
|
+
the original Go-lang [GNfinder] README file.
|
39
45
|
|
40
|
-
First you need to create
|
46
|
+
First you need to create an instance of a `gnfinder` client
|
41
47
|
|
42
48
|
```ruby
|
43
49
|
require 'gnfinder'
|
@@ -45,25 +51,24 @@ require 'gnfinder'
|
|
45
51
|
gf = Gnfinder::Client.new
|
46
52
|
```
|
47
53
|
|
48
|
-
By default the client will try to connect to
|
49
|
-
have another location for the
|
50
|
-
|
51
|
-
|
54
|
+
By default the client will try to connect to
|
55
|
+
`https://gnfinder.globalnames.org/api/v1`. If you have another location for the
|
56
|
+
server use:
|
52
57
|
|
53
58
|
```ruby
|
54
59
|
require 'gnfinder'
|
55
60
|
|
56
61
|
# you can use global public gnfinder server
|
57
62
|
# located at finder-rpc.globalnames.org
|
58
|
-
gf = Gnfinder::Client.new(host = 'finder
|
63
|
+
gf = Gnfinder::Client.new(host = 'finder.example.org', port = 80)
|
59
64
|
|
60
|
-
# localhost,
|
65
|
+
# localhost, port 8000
|
61
66
|
gf = Gnfinder::Client.new(host = '0.0.0.0', port = 8000)
|
62
67
|
```
|
63
68
|
|
64
69
|
### Finding names in a text using default settings
|
65
70
|
|
66
|
-
You can find format of returning result in [
|
71
|
+
You can find format of returning result in [GNfinder API docs]
|
67
72
|
|
68
73
|
```ruby
|
69
74
|
txt = File.read('utf8-text-with-names.txt')
|
@@ -73,7 +78,39 @@ puts res.names[0].value
|
|
73
78
|
puts res.names[0].odds
|
74
79
|
```
|
75
80
|
|
76
|
-
|
81
|
+
### Finding names by a URL
|
82
|
+
|
83
|
+
If you need to find names in an HTML page, or a PDF document available on
|
84
|
+
Internet, use `find_url` method.
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
url = 'https://en.wikipedia.org/wiki/Monochamus_galloprovincialis'
|
88
|
+
res = gf.find_url(url)
|
89
|
+
puts res.names[0].value
|
90
|
+
puts res.names[0].odds
|
91
|
+
```
|
92
|
+
|
93
|
+
### Finding names in a file
|
94
|
+
|
95
|
+
Many different file types are supported (PDF, JPB, TIFF, MS Word, MS Excel
|
96
|
+
etc).
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
path = "/path/to/file.pdf"
|
100
|
+
res = gf.find_file(path)
|
101
|
+
puts res.names[0].value
|
102
|
+
```
|
103
|
+
|
104
|
+
Support of file-uploading uses 'multipart/form' approach. Here is an
|
105
|
+
illustration for `curl`:
|
106
|
+
|
107
|
+
```bash
|
108
|
+
curl -v -F sources[]=1 -F sources[]=12 -F file=@file.pdf \
|
109
|
+
https://finder.globalnames.org/api/v1/find
|
110
|
+
```
|
111
|
+
|
112
|
+
Returned result is quite detailed and contains many accessor methods, for
|
113
|
+
example:
|
77
114
|
|
78
115
|
* value: name-string cleaned up for verification.
|
79
116
|
* verbatim: name-string as it was found in the text.
|
@@ -159,35 +196,20 @@ res = gf.find_names(txt, verification: true, sources: [1, 4, 179])
|
|
159
196
|
### Combination of parameters.
|
160
197
|
|
161
198
|
It is possible to combine parameters. However if a parameter makes no sense in
|
162
|
-
a particular context
|
199
|
+
a particular context it is silently ignored.
|
163
200
|
|
164
201
|
```ruby
|
165
202
|
# Runs Bayes' algorithms using English training set, runs verification and
|
166
203
|
# returns matched results for 3 data-sources if they are available.
|
167
|
-
res = gf.find_names(txt, language: eng, verification: true,
|
204
|
+
res = gf.find_names(txt, language: 'eng', verification: true,
|
168
205
|
sources: [1, 4, 179])
|
169
206
|
|
170
207
|
# Ignores `sources:` settings, because `with_verification` is not set to `true`
|
171
|
-
res = gf.find_names(txt, language: eng, sources: [1, 4, 179])
|
208
|
+
res = gf.find_names(txt, language: 'eng', sources: [1, 4, 179])
|
172
209
|
```
|
173
210
|
|
174
211
|
## Development
|
175
212
|
|
176
|
-
This gem uses gRPC to access [gnfinder] server. gRPC in turn depends on a
|
177
|
-
protobuf library. If you need to compile Ruby programs with protobuf you need
|
178
|
-
to install [Go] language and download [gnfinder] project.
|
179
|
-
|
180
|
-
```bash
|
181
|
-
go get github.com/gnames/gnfinder
|
182
|
-
```
|
183
|
-
Then you need to run bundle from the root of the project and generate
|
184
|
-
grpc files:
|
185
|
-
|
186
|
-
```bash
|
187
|
-
bundle
|
188
|
-
rake grpc
|
189
|
-
```
|
190
|
-
|
191
213
|
If you get an error, you might need to set a ``GOPATH`` environment variable.
|
192
214
|
|
193
215
|
After starting the server with default host and port (localhost:8778) you will
|
@@ -208,10 +230,10 @@ To run tests without rubocop
|
|
208
230
|
bundle exec rspec
|
209
231
|
```
|
210
232
|
|
211
|
-
[
|
233
|
+
[GNfinder]: https://github.com/gnames/gnfinder
|
212
234
|
[gnfinder recent release]: https://github.com/gnames/gnfinder/releases
|
213
235
|
[Go]: https://golang.org/doc/install
|
214
236
|
[client]: https://github.com/GlobalNamesArchitecture/gnfinder/blob/master/lib/gnfinder/client.rb
|
215
237
|
[data-source list]: http://index.globalnames.org/datasource
|
216
|
-
[
|
217
|
-
[
|
238
|
+
[tests]: https://github.com/GlobalNamesArchitecture/gnfinder/blob/master/spec/lib/client_spec.rb
|
239
|
+
[GNfinder API docs]: https://apidoc.globalnames.org/gnfinder
|
data/Rakefile
CHANGED
@@ -24,16 +24,7 @@ RSpec::Core::RakeTask.new(:rcov) do |spec|
|
|
24
24
|
spec.rcov = true
|
25
25
|
end
|
26
26
|
|
27
|
-
task :grpc do
|
28
|
-
cmd = 'grpc_tools_ruby_protoc ' \
|
29
|
-
'-I $GOPATH/src/github.com/gnames/gnfinder/protob ' \
|
30
|
-
'--ruby_out=lib --grpc_out=lib ' \
|
31
|
-
'$GOPATH/src/github.com/gnames/gnfinder/protob/protob.proto'
|
32
|
-
puts cmd
|
33
|
-
`#{cmd}`
|
34
|
-
end
|
35
|
-
|
36
27
|
require 'rubocop/rake_task'
|
37
28
|
RuboCop::RakeTask.new
|
38
29
|
|
39
|
-
task default: %i[rubocop
|
30
|
+
task default: %i[rubocop spec]
|
data/gnfinder.gemspec
CHANGED
@@ -20,12 +20,14 @@ 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 = '
|
24
|
-
gem.add_dependency '
|
25
|
-
gem.
|
26
|
-
gem.add_development_dependency 'bundler', '~> 2.1'
|
23
|
+
gem.required_ruby_version = '>= 2.6', '< 4'
|
24
|
+
gem.add_dependency 'rest-client', '~> 2.1'
|
25
|
+
gem.add_development_dependency 'bundler', '~> 2.2'
|
27
26
|
gem.add_development_dependency 'byebug', '~> 11.1'
|
28
27
|
gem.add_development_dependency 'rake', '~> 13.0'
|
29
|
-
gem.add_development_dependency 'rspec', '~> 3.
|
30
|
-
gem.add_development_dependency 'rubocop', '~>
|
28
|
+
gem.add_development_dependency 'rspec', '~> 3.10'
|
29
|
+
gem.add_development_dependency 'rubocop', '~> 1.21'
|
30
|
+
gem.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
31
|
+
gem.add_development_dependency 'rubocop-rspec', '~> 2.4'
|
32
|
+
gem.add_development_dependency 'solargraph', '~> 0.43'
|
31
33
|
end
|
data/lib/gnfinder/client.rb
CHANGED
@@ -1,62 +1,92 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Gnfinder
|
4
|
-
GNFINDER_MIN_VERSION = 'v0.11.0'
|
5
|
-
|
6
4
|
# Gnfinder::Client connects to gnfinder server
|
7
5
|
class Client
|
8
|
-
def initialize(host = '
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
raise 'gRPC server of gnfinder should be at least ' \
|
15
|
-
' #{GNFINDER_MIN_VERSION}.\n Download latest version from ' \
|
16
|
-
'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
|
17
12
|
end
|
18
13
|
|
19
|
-
def
|
20
|
-
|
21
|
-
ver =
|
22
|
-
|
23
|
-
|
24
|
-
return true if ver[2] >= min_ver[2]
|
14
|
+
def gnfinder_version
|
15
|
+
resp = @site['/version'].get
|
16
|
+
ver = JSON.parse(resp.body, symbolize_names: true)
|
17
|
+
OpenStruct.new(ver)
|
18
|
+
end
|
25
19
|
|
26
|
-
|
20
|
+
def ping
|
21
|
+
@site['/ping'].get.body
|
27
22
|
end
|
28
23
|
|
29
|
-
def
|
30
|
-
|
24
|
+
def find_file(path, opts = {})
|
25
|
+
params = {}
|
26
|
+
update_params(params, opts)
|
27
|
+
file = File.new(path, 'rb')
|
28
|
+
params = params.merge(file: file)
|
29
|
+
resp = @site['find'].post(params)
|
30
|
+
prepare_result(resp)
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
|
33
|
+
def find_url(url, opts = {})
|
34
|
+
return to_open_struct({ "names": [] }) if url.to_s.strip == ''
|
35
|
+
|
36
|
+
params = { url: url }
|
37
|
+
find(params, opts)
|
35
38
|
end
|
36
39
|
|
37
|
-
# rubocop:disable all
|
38
40
|
def find_names(text, opts = {})
|
39
|
-
if text.to_s.strip == ''
|
40
|
-
return Protob::Output.new
|
41
|
-
end
|
41
|
+
return to_open_struct({ "names": [] }) if text.to_s.strip == ''
|
42
42
|
|
43
43
|
params = { text: text }
|
44
|
-
params
|
44
|
+
find(params, opts)
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
# rubocop:disable all
|
50
|
+
def find(params, opts = {})
|
51
|
+
update_params(params, opts)
|
52
|
+
|
53
|
+
resp = @site['find'].post params.to_json, {content_type: :json, accept: :json}
|
54
|
+
prepare_result(resp)
|
55
|
+
end
|
56
|
+
# rubocop:enable all
|
57
|
+
|
58
|
+
def prepare_result(response)
|
59
|
+
output = JSON.parse(response.body)
|
60
|
+
res = output['metadata']
|
61
|
+
res['names'] = output['names'] || []
|
62
|
+
res = res.deep_transform_keys(&:underscore)
|
63
|
+
res['names'] = [] if res['names'].nil?
|
64
|
+
to_open_struct(res)
|
65
|
+
end
|
66
|
+
|
67
|
+
# rubocop:disable all
|
68
|
+
def update_params(params, opts)
|
69
|
+
params[:noBayes] = true if opts[:no_bayes]
|
70
|
+
params[:oddsDetails] = true if opts[:odds_details]
|
45
71
|
params[:language] = opts[:language] if opts[:language].to_s.strip != ''
|
46
|
-
if opts[:detect_language]
|
47
|
-
params[:detect_language] = opts[:detect_language]
|
48
|
-
end
|
49
|
-
params[:verification] = true if opts[:verification]
|
50
|
-
if opts[:sources] && !opts[:sources].empty?
|
51
|
-
params[:sources] = opts[:sources]
|
52
|
-
end
|
53
72
|
|
54
|
-
if opts[:
|
55
|
-
|
56
|
-
|
73
|
+
params[:wordsAround] = opts[:words_around] if opts[:words_around] && opts[:words_around].positive?
|
74
|
+
|
75
|
+
params[:verification] = true if opts[:verification]
|
57
76
|
|
58
|
-
|
77
|
+
params[:sources] = opts[:sources] if opts[:sources] && !opts[:sources].empty?
|
59
78
|
end
|
60
79
|
# rubocop:enable all
|
80
|
+
|
81
|
+
def to_open_struct(obj)
|
82
|
+
case obj
|
83
|
+
when Hash
|
84
|
+
OpenStruct.new(obj.transform_values { |val| to_open_struct(val) })
|
85
|
+
when Array
|
86
|
+
obj.map { |o| to_open_struct(o) }
|
87
|
+
else # Assumed to be a primitive value
|
88
|
+
obj
|
89
|
+
end
|
90
|
+
end
|
61
91
|
end
|
62
92
|
end
|
data/lib/gnfinder/version.rb
CHANGED
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,141 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gnfinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.1
|
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:
|
11
|
+
date: 2021-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1
|
19
|
+
version: '2.1'
|
20
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: '1
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
type: :
|
33
|
+
version: '2.2'
|
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: '
|
40
|
+
version: '2.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
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: '
|
54
|
+
version: '11.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
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: '
|
68
|
+
version: '13.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
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: '
|
82
|
+
version: '3.10'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '1.21'
|
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: '
|
96
|
+
version: '1.21'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
98
|
+
name: rubocop-rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.6.0
|
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:
|
110
|
+
version: 0.6.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.4'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.4'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: solargraph
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.43'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.43'
|
111
139
|
description: |-
|
112
140
|
The gem searches for scientific names in texts using
|
113
141
|
gRPC server running gnfinder app written in Go language
|
@@ -116,6 +144,7 @@ executables: []
|
|
116
144
|
extensions: []
|
117
145
|
extra_rdoc_files: []
|
118
146
|
files:
|
147
|
+
- ".github/workflows/ruby.yml"
|
119
148
|
- ".gitignore"
|
120
149
|
- ".rspec"
|
121
150
|
- ".rubocop.yml"
|
@@ -128,29 +157,31 @@ files:
|
|
128
157
|
- lib/gnfinder.rb
|
129
158
|
- lib/gnfinder/client.rb
|
130
159
|
- lib/gnfinder/version.rb
|
131
|
-
- lib/
|
132
|
-
- lib/protob_services_pb.rb
|
160
|
+
- lib/hash.rb
|
133
161
|
homepage: http://github.com/GlobalNamesArchitecture/gnfinder
|
134
162
|
licenses:
|
135
163
|
- MIT
|
136
164
|
metadata: {}
|
137
|
-
post_install_message:
|
165
|
+
post_install_message:
|
138
166
|
rdoc_options: []
|
139
167
|
require_paths:
|
140
168
|
- lib
|
141
169
|
required_ruby_version: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
|
-
- - "
|
171
|
+
- - ">="
|
144
172
|
- !ruby/object:Gem::Version
|
145
173
|
version: '2.6'
|
174
|
+
- - "<"
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '4'
|
146
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
178
|
requirements:
|
148
179
|
- - ">="
|
149
180
|
- !ruby/object:Gem::Version
|
150
181
|
version: '0'
|
151
182
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
153
|
-
signing_key:
|
183
|
+
rubygems_version: 3.2.22
|
184
|
+
signing_key:
|
154
185
|
specification_version: 4
|
155
186
|
summary: Scientific names finder
|
156
187
|
test_files: []
|
data/lib/protob_pb.rb
DELETED
@@ -1,112 +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, 2
|
20
|
-
optional :language, :string, 3
|
21
|
-
optional :detect_language, :bool, 4
|
22
|
-
optional :verification, :bool, 5
|
23
|
-
optional :tokens_around, :int32, 6
|
24
|
-
repeated :sources, :int32, 7
|
25
|
-
end
|
26
|
-
add_message "protob.Output" do
|
27
|
-
optional :date, :string, 1
|
28
|
-
optional :finder_version, :string, 2
|
29
|
-
repeated :approach, :enum, 3, "protob.Approach"
|
30
|
-
optional :tokens_around, :int32, 4
|
31
|
-
optional :language, :string, 5
|
32
|
-
optional :language_detected, :string, 6
|
33
|
-
optional :detect_language, :bool, 7
|
34
|
-
optional :total_tokens, :int32, 8
|
35
|
-
optional :total_candidates, :int32, 9
|
36
|
-
optional :total_names, :int32, 10
|
37
|
-
repeated :names, :message, 11, "protob.NameString"
|
38
|
-
end
|
39
|
-
add_message "protob.NameString" do
|
40
|
-
optional :cardinality, :int32, 1
|
41
|
-
optional :verbatim, :string, 3
|
42
|
-
optional :name, :string, 4
|
43
|
-
optional :odds, :float, 5
|
44
|
-
optional :annot_nomen, :string, 6
|
45
|
-
optional :annot_nomen_type, :enum, 7, "protob.AnnotNomenType"
|
46
|
-
optional :offset_start, :int32, 8
|
47
|
-
optional :offset_end, :int32, 9
|
48
|
-
repeated :words_before, :string, 10
|
49
|
-
repeated :words_after, :string, 11
|
50
|
-
optional :verification, :message, 12, "protob.Verification"
|
51
|
-
end
|
52
|
-
add_message "protob.Verification" do
|
53
|
-
optional :best_result, :message, 1, "protob.ResultData"
|
54
|
-
repeated :preferred_results, :message, 2, "protob.ResultData"
|
55
|
-
optional :data_sources_num, :int32, 3
|
56
|
-
optional :data_source_quality, :string, 4
|
57
|
-
optional :retries, :int32, 5
|
58
|
-
optional :error, :string, 6
|
59
|
-
end
|
60
|
-
add_message "protob.ResultData" do
|
61
|
-
optional :data_source_id, :int32, 1
|
62
|
-
optional :data_source_title, :string, 2
|
63
|
-
optional :taxon_id, :string, 3
|
64
|
-
optional :matched_name, :string, 4
|
65
|
-
optional :matched_cardinality, :int32, 5
|
66
|
-
optional :matched_canonical_simple, :string, 6
|
67
|
-
optional :matched_canonical_full, :string, 7
|
68
|
-
optional :current_name, :string, 8
|
69
|
-
optional :current_cardinality, :int32, 9
|
70
|
-
optional :current_canonical_simple, :string, 10
|
71
|
-
optional :current_canonical_full, :string, 11
|
72
|
-
optional :synonym, :bool, 12
|
73
|
-
optional :classification_path, :string, 13
|
74
|
-
optional :classification_rank, :string, 14
|
75
|
-
optional :classification_ids, :string, 15
|
76
|
-
optional :edit_distance, :int32, 16
|
77
|
-
optional :stem_edit_distance, :int32, 17
|
78
|
-
optional :match_type, :enum, 18, "protob.MatchType"
|
79
|
-
end
|
80
|
-
add_enum "protob.MatchType" do
|
81
|
-
value :NONE, 0
|
82
|
-
value :EXACT, 1
|
83
|
-
value :FUZZY, 2
|
84
|
-
value :PARTIAL_EXACT, 3
|
85
|
-
value :PARTIAL_FUZZY, 4
|
86
|
-
end
|
87
|
-
add_enum "protob.AnnotNomenType" do
|
88
|
-
value :NO_ANNOT, 0
|
89
|
-
value :SP_NOV, 1
|
90
|
-
value :COMB_NOV, 2
|
91
|
-
value :SUBSP_NOV, 3
|
92
|
-
end
|
93
|
-
add_enum "protob.Approach" do
|
94
|
-
value :HEURISTIC, 0
|
95
|
-
value :BAYES, 1
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
module Protob
|
101
|
-
Void = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Void").msgclass
|
102
|
-
Pong = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Pong").msgclass
|
103
|
-
Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Version").msgclass
|
104
|
-
Params = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Params").msgclass
|
105
|
-
Output = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Output").msgclass
|
106
|
-
NameString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.NameString").msgclass
|
107
|
-
Verification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Verification").msgclass
|
108
|
-
ResultData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.ResultData").msgclass
|
109
|
-
MatchType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.MatchType").enummodule
|
110
|
-
AnnotNomenType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.AnnotNomenType").enummodule
|
111
|
-
Approach = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protob.Approach").enummodule
|
112
|
-
end
|
data/lib/protob_services_pb.rb
DELETED
@@ -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
|