dwc_agent 1.5.1.2 → 1.5.1.3
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 +4 -4
- data/lib/dwc_agent/constants.rb +5 -3
- data/lib/dwc_agent/parser.rb +2 -6
- data/lib/dwc_agent/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f1a07e6b4a0c4819107295a79d395321dbf73772c81cb32013a66a88baeedda
|
4
|
+
data.tar.gz: b686b2cbcefb91d8a35f24e6364528683b40f15a833b5c7a5297f862b7ff64a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 120885a8b97055dcc5e91ad5a00c763b4de2db4a825557f6a8231f3ef314a160a59d24352f2f56bdaa78b61539b7c794801b64bf53af3c0893fbbdb5b36edb6a
|
7
|
+
data.tar.gz: 3d3529434a1e5be6ab372dff55af6cb0debedfc8dbbcd9f78a00d3b62093487359d054c62df33723bd56ee1dffa7bcf9c3102dda28a0cca77b40529fea5fc3fd
|
data/lib/dwc_agent/constants.rb
CHANGED
@@ -191,9 +191,11 @@ module DwcAgent
|
|
191
191
|
'-Jr' => ' Jr.'
|
192
192
|
}
|
193
193
|
|
194
|
-
|
195
|
-
^(
|
196
|
-
|
194
|
+
SEPARATORS = {
|
195
|
+
"^(\\S{4,},\\s+(?:\\S\\.\\s*){1,})\\s+(\\S{4,},\\s+(?:\\S\.\\s*){1,})$" => "\\1 | \\2",
|
196
|
+
"(\\S{1}\\.)([[:alpha:]]{2,})" => "\\1 \\2",
|
197
|
+
"(.*)\s+(.*)\s+(van|von)$" => "\\3 \\1, \\2"
|
198
|
+
}
|
197
199
|
|
198
200
|
BLACKLIST = %r{
|
199
201
|
(?i:abundant)|
|
data/lib/dwc_agent/parser.rb
CHANGED
@@ -16,13 +16,10 @@ module DwcAgent
|
|
16
16
|
suffix: SUFFIX
|
17
17
|
}
|
18
18
|
@namae = Namae::Parser.new(options)
|
19
|
-
|
20
19
|
@strip_out_regex = Regexp.new STRIP_OUT.to_s
|
21
|
-
@residual_terminators_regex = Regexp.new SPLIT_BY.to_s + %r{\s*\z}.to_s
|
22
20
|
@char_subs_regex = Regexp.new [CHAR_SUBS.keys.join].to_s
|
23
21
|
@phrase_subs_regex = Regexp.new PHRASE_SUBS.keys.map{|a| Regexp.escape a }.join('|').to_s
|
24
|
-
@
|
25
|
-
@add_separators_regex = Regexp.new %r{(\S{1}\.)([[:alpha:]]{2,})}.to_s
|
22
|
+
@residual_terminators_regex = Regexp.new SPLIT_BY.to_s + %r{\s*\z}.to_s
|
26
23
|
end
|
27
24
|
|
28
25
|
# Parses the passed-in string and returns a list of names.
|
@@ -35,8 +32,7 @@ module DwcAgent
|
|
35
32
|
name.gsub!(/\[|\]/, '')
|
36
33
|
name.gsub!(@char_subs_regex, CHAR_SUBS)
|
37
34
|
name.gsub!(@phrase_subs_regex, PHRASE_SUBS)
|
38
|
-
name.gsub!(
|
39
|
-
name.gsub!(@complex_separators_regex, '\1 | \2')
|
35
|
+
SEPARATORS.each{|key, value| name.gsub!(Regexp.new(key), value)}
|
40
36
|
name.gsub!(@residual_terminators_regex, '')
|
41
37
|
name.squeeze!(' ')
|
42
38
|
name.strip!
|
data/lib/dwc_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dwc_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.1.
|
4
|
+
version: 1.5.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David P. Shorthouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: namae
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
122
|
+
rubygems_version: 3.2.4
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Parse Darwin Core agent terms such as recordedBy and identifiedBy
|