gnparser 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3dc26ce2cf1c9838a910e9d4fcd38f5b511b7fe28dffff1b0f1749d35c97365
4
- data.tar.gz: '038fd9a682da0115201370edb16bbdfaec0871d933da5df014e658371b2c91d6'
3
+ metadata.gz: 849f40bfbac283e1a93a0fe8bca7d00485e07382c4f41355890989710ffa89f6
4
+ data.tar.gz: bb79d9b08d7a6ace2f922b64e0679dc09fbf51131561d5f16523d050de7424a0
5
5
  SHA512:
6
- metadata.gz: d70363cd8b27e6f114979f35339d53fe64dd0eeb7c995aabb84a2eb3cf1335b4510bf9ebc4231cea585f18fe14115b55fe3d675775d4d80ef54dde6c14164189
7
- data.tar.gz: 989134d36fc7508f474de59fc5e575406df0fc42b1803a6d229ec003e3871e8ec8b824e3e6e69665ac0496ff6c23f34ec119879390d3f492bb4fe8763e5ebdca
6
+ metadata.gz: ea8a7c40037914ba823f3b898ded00149e590d627acb3a9938684eea7fea69a6f6a7e3e1e4c45fcf5c236c9de624d5eebe74b716266823e6a9f953636723a9a1
7
+ data.tar.gz: 62116e4cc3410a4098a7a250cf9ee5a630df9fe5892c6fff03ffe92ed8916522099a61da63cbffca76189c46f9887b5d5e57f243f37763e0dd69cd9f0d7bc6d2
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
6
+ *.swp
7
+ *.swo
8
+ biodiversity*.gem
9
+ *json
10
+ *xml
11
+ tmp
12
+ .DS_Store
13
+ spec/parser/test_data_new.txt
14
+ t
15
+ bin
16
+ .bundle
17
+ bundle_bin
18
+ Gemfile.lock
data/Gemfile.lock CHANGED
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gnparser (0.1.1)
4
+ gnparser (0.1.2)
5
+ grpc (~> 1.15)
6
+ grpc-tools (~> 1.15)
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
@@ -54,8 +56,6 @@ DEPENDENCIES
54
56
  bundler (~> 1.16)
55
57
  byebug (~> 10.0)
56
58
  gnparser!
57
- grpc (~> 1.15)
58
- grpc-tools (~> 1.15)
59
59
  rake (~> 12.3)
60
60
  rspec (~> 3.8)
61
61
  rubocop (~> 0.59)
data/README.md CHANGED
@@ -5,6 +5,83 @@ gRPC client to [gnparser] project
5
5
  ## Overview
6
6
 
7
7
  ``gnparser`` is a Ruby gem that allows to parse scientific names extremely
8
- fast using remote method calls to [gnparser].
8
+ fast using remote gRPC method calls to [gnparser] written in Go.
9
9
 
10
- [gnparser]: https://gitlab.com/gogna/gnparser
10
+ ## Install
11
+
12
+ ```bash
13
+ gem install gnparser
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ [Download][releases] the latest version of Go gnparser, and start it
19
+ on your local machine as a grpc server:
20
+
21
+ ```bash
22
+ gnparser -g 8778
23
+ ```
24
+
25
+ Now you will be able to use Ruby gnparser with its default settings.
26
+
27
+ ```ruby
28
+ require 'gnparser'
29
+ gnp = GNparser::Client.new
30
+ ```
31
+
32
+ ### Output format
33
+
34
+ gem supports the following formats:
35
+
36
+ **compact**
37
+ : JSON output in one line. This is the default format.
38
+
39
+ **pretty**
40
+ : ``Pretty`` JSON output.
41
+
42
+ **simple**
43
+ : Pipe-separated string where the fiels are, id, verbatim name, canonical form,
44
+ extended canonical form, authorship, year, quality of parsing.
45
+
46
+ **debug**
47
+ : Abtract Syntax Tree of the parsed result.
48
+
49
+ ### Parse one name
50
+
51
+ ```ruby
52
+ res = gnp.parse('Puma concolor L.')
53
+ puts res.value
54
+ puts res.error
55
+ ```
56
+
57
+ For non-default format:
58
+
59
+ ```ruby
60
+ res = gnp.parse('Puma concolor (Linn.)', :pretty)
61
+ ...
62
+ res = gnp.parse('Puma concolor (Linn.)', 'pretty')
63
+ ...
64
+ res = gnp.parse('Puma concolor (Linn.)', 'simple')
65
+ ...
66
+ res = gnp.parse('Puma concolor (Linn.)', :simple)
67
+ ...
68
+ ```
69
+
70
+ ### Parse an array of names
71
+
72
+ ```ruby
73
+ names = ['Plantago major L.', 'Homo sapiens Linn. 1758', 'Bubo bubo']
74
+ res = gnp.parse_ary(names, :pretty)
75
+ ```
76
+
77
+ ### Parse names from a file
78
+
79
+ File should have one name string per line.
80
+
81
+ ```ruby
82
+ path = File.join(__dir__, "path", "to", "names.txt")
83
+ res = gnp.parse_file(path, :compact)
84
+ ```
85
+
86
+ [gnparser]: https://gitlab.com/gogna/gnparser
87
+ [releases]: https://gitlab.com/gogna/gnparser/releases
@@ -21,10 +21,10 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.require_paths = ['lib']
23
23
  gem.required_ruby_version = '~> 2.5'
24
+ gem.add_dependency 'grpc', '~> 1.15'
25
+ gem.add_dependency 'grpc-tools', '~> 1.15'
24
26
  gem.add_development_dependency 'bundler', '~> 1.16'
25
27
  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
28
  gem.add_development_dependency 'rake', '~> 12.3'
29
29
  gem.add_development_dependency 'rspec', '~> 3.8'
30
30
  gem.add_development_dependency 'rubocop', '~> 0.59'
@@ -2,7 +2,7 @@
2
2
 
3
3
  # GNparser is a namespace module for gnparser gem.
4
4
  module GNparser
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
 
7
7
  def self.version
8
8
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnparser
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
  - Dmitry Mozzherin
@@ -11,61 +11,61 @@ cert_chain: []
11
11
  date: 2019-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: grpc
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
20
- type: :development
19
+ version: '1.15'
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.16'
26
+ version: '1.15'
27
27
  - !ruby/object:Gem::Dependency
28
- name: byebug
28
+ name: grpc-tools
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
33
+ version: '1.15'
34
+ type: :runtime
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: '1.15'
41
41
  - !ruby/object:Gem::Dependency
42
- name: grpc
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.15'
47
+ version: '1.16'
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: '1.16'
55
55
  - !ruby/object:Gem::Dependency
56
- name: grpc-tools
56
+ name: byebug
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.15'
61
+ version: '10.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: '10.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -117,6 +117,7 @@ extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
119
  - ".byebug_history"
120
+ - ".gitignore"
120
121
  - ".rspec"
121
122
  - ".rubocop.yml"
122
123
  - ".vscode/settings.json"
@@ -126,13 +127,12 @@ files:
126
127
  - LICENSE
127
128
  - README.md
128
129
  - Rakefile
129
- - gnparser_rb.gemspec
130
+ - gnparser.gemspec
130
131
  - lib/gnparser.rb
131
132
  - lib/gnparser/client.rb
132
133
  - lib/gnparser/version.rb
133
134
  - lib/gnparser_pb.rb
134
135
  - lib/gnparser_services_pb.rb
135
- - pkg/gnparser-0.1.0.gem
136
136
  homepage: http://gitlab.com/gnames/gnparser_rb
137
137
  licenses:
138
138
  - MIT
Binary file