biodiversity 5.3.0 → 5.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.ruby-version +1 -1
- data/README.md +1 -1
- data/biodiversity.gemspec +1 -0
- data/clib/linux/libgnparser.so +0 -0
- data/clib/mac/libgnparser.so +0 -0
- data/clib/win/libgnparser.so +0 -0
- data/lib/biodiversity/parser.rb +5 -2
- data/lib/biodiversity/version.rb +2 -2
- data/spec/lib/parser_spec.rb +13 -3
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39d4d3753604b4ec5141a9d9425eefc4f07d671d7aeb6dd28d05481821218f85
|
4
|
+
data.tar.gz: 91cc30f4dc1efa44af6bf17992fd59f2b3f11c6856c1cb830f910184a16585ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87156cd1064fc9ea20a58044b48a2ae98a9e5da04e4ac1cfde0d1124d522dfba86399bb87a2d88fdeb4fb7da7d82776fd2d5656857e56578aaf3cd6b3c229bee
|
7
|
+
data.tar.gz: ec24a9460b0a13860dc287f73578f4ee81f4effd514e3238c16d2d6ca661a04a9c1a9be3fa4b872fdd3c3ffb5058992ea39d0e4fc8ef273998a31ba585cad9d2
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.2
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Biodiversity
|
2
2
|
|
3
|
-
[![DOI](https://zenodo.org/badge/
|
3
|
+
[![DOI](https://zenodo.org/badge/764046.svg)](https://zenodo.org/badge/latestdoi/764046)
|
4
4
|
[![Gem Version][gem_svg]][gem_link]
|
5
5
|
[![Continuous Integration Status][ci_svg]][ci_link]
|
6
6
|
|
data/biodiversity.gemspec
CHANGED
data/clib/linux/libgnparser.so
CHANGED
Binary file
|
data/clib/mac/libgnparser.so
CHANGED
Binary file
|
data/clib/win/libgnparser.so
CHANGED
Binary file
|
data/lib/biodiversity/parser.rb
CHANGED
@@ -57,11 +57,14 @@ module Biodiversity
|
|
57
57
|
with_details, with_cultivars)
|
58
58
|
free_mem(ptr)
|
59
59
|
if simple
|
60
|
-
CSV.new(parsed).map do |row|
|
60
|
+
CSV.new(parsed.force_encoding('UTF-8')).map do |row|
|
61
61
|
csv_row(row)
|
62
62
|
end
|
63
63
|
else
|
64
|
-
JSON.parse(parsed, symbolize_names: true)
|
64
|
+
JSON.parse(parsed, symbolize_names: true).map do |item|
|
65
|
+
item[:parserVersion] = Biodiversity.gnparser_version
|
66
|
+
item
|
67
|
+
end
|
65
68
|
end
|
66
69
|
end
|
67
70
|
|
data/lib/biodiversity/version.rb
CHANGED
data/spec/lib/parser_spec.rb
CHANGED
@@ -49,18 +49,25 @@ describe Biodiversity::Parser do
|
|
49
49
|
describe('parse_ary') do
|
50
50
|
it 'parses names in simple format' do
|
51
51
|
parsed = subject.parse_ary(
|
52
|
-
['Homo sapiens Linn.', 'Pardosa moesta'],
|
53
|
-
simple: true
|
52
|
+
['Homo sapiens Linn.', 'Pardosa moesta', 'Aus bus "White Russian"'],
|
53
|
+
simple: true, with_cultivars: true
|
54
54
|
)
|
55
55
|
expect(parsed[0][:canonical][:simple]).to eq 'Homo sapiens'
|
56
56
|
expect(parsed[0][:normalized]).to be_nil
|
57
57
|
|
58
58
|
expect(parsed[1][:canonical][:simple]).to eq 'Pardosa moesta'
|
59
|
+
expect(parsed[2][:canonical][:simple]).to eq 'Aus bus ‘White Russian’'
|
60
|
+
expect(parsed[2][:quality]).to eq 1
|
59
61
|
end
|
60
62
|
|
61
63
|
it 'parsed name in full format' do
|
62
64
|
parsed = subject.parse_ary(
|
63
|
-
[
|
65
|
+
[
|
66
|
+
'Homo sapiens Linn.',
|
67
|
+
'Tobacco Mosaic Virus',
|
68
|
+
"Aus bus 'White Russian'"
|
69
|
+
],
|
70
|
+
with_cultivars: true
|
64
71
|
)
|
65
72
|
expect(parsed[0][:canonical][:simple]).to eq 'Homo sapiens'
|
66
73
|
expect(parsed[0][:normalized]).to eq 'Homo sapiens Linn.'
|
@@ -68,6 +75,9 @@ describe Biodiversity::Parser do
|
|
68
75
|
expect(parsed[1][:parsed]).to be false
|
69
76
|
expect(parsed[1][:virus]).to be true
|
70
77
|
expect(parsed[1][:words]).to be_nil
|
78
|
+
expect(parsed[2][:canonical][:simple]).to eq 'Aus bus ‘White Russian’'
|
79
|
+
expect(parsed[2][:quality]).to eq 1
|
80
|
+
expect(parsed[2][:parserVersion]).to match(/GNparser/)
|
71
81
|
end
|
72
82
|
end
|
73
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biodiversity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.3.
|
4
|
+
version: 5.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Mozzherin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.8'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: solargraph
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.43'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.43'
|
97
111
|
description: Parsing tool for biodiversity informatics
|
98
112
|
email: dmozzherin@gmail.com
|
99
113
|
executables: []
|
@@ -142,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
156
|
- !ruby/object:Gem::Version
|
143
157
|
version: '0'
|
144
158
|
requirements: []
|
145
|
-
rubygems_version: 3.2.
|
159
|
+
rubygems_version: 3.2.22
|
146
160
|
signing_key:
|
147
161
|
specification_version: 4
|
148
162
|
summary: Parser of scientific names
|