dwc_agent 3.0.17.0 → 3.0.19.0
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/cleaner.rb +5 -1
- data/lib/dwc_agent/constants.rb +20 -4
- data/lib/dwc_agent/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 232c24dde9ae5ecd8221049ab24283c2480c7d09df539f0eeef6b03729295360
|
4
|
+
data.tar.gz: 3fa7afa2113b78326938849744cf2e6a5a1f4949ba8567c0dac200872a72c62f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a5778f3d32830ff95a2790c320d838df3c2e08937d8ca66cd1d3bf2a84560ce46b286f259bb213b7cf29c298d817c5f33d8ec09f958d65fd255825dc9dc1860
|
7
|
+
data.tar.gz: 8c01720ea2044073e3c850956e74b0a01f723350abb8b6d98183f9f8a6952f17dcbb5f64ab19311d72d57ff191634c783bc2b9e93cd40fd6c1819fa6c8de83fe
|
data/lib/dwc_agent/cleaner.rb
CHANGED
@@ -78,7 +78,6 @@ module DwcAgent
|
|
78
78
|
parsed_namae.family &&
|
79
79
|
parsed_namae.family.length <=3 &&
|
80
80
|
parsed_namae.family == parsed_namae.family.upcase &&
|
81
|
-
#parsed_namae.family != NameCase(parsed_namae.family) &&
|
82
81
|
parsed_namae.given[-1] != "."
|
83
82
|
given = parsed_namae.given
|
84
83
|
family = parsed_namae.family
|
@@ -168,6 +167,11 @@ module DwcAgent
|
|
168
167
|
return default
|
169
168
|
end
|
170
169
|
|
170
|
+
if !family.nil? && family.downcase.count(VOWELS) == 0 &&
|
171
|
+
!FAMILY_GREENLIST.any?{ |s| s.casecmp(family) == 0 }
|
172
|
+
return default
|
173
|
+
end
|
174
|
+
|
171
175
|
name = {
|
172
176
|
title: title,
|
173
177
|
appellation: appellation,
|
data/lib/dwc_agent/constants.rb
CHANGED
@@ -208,7 +208,8 @@ module DwcAgent
|
|
208
208
|
'-Jr' => ' Jr.',
|
209
209
|
'Dr.' => 'Dr. ',
|
210
210
|
'prof.' => 'Prof. ',
|
211
|
-
' .;' => '. ;'
|
211
|
+
' .;' => '. ;',
|
212
|
+
', &' => ' &'
|
212
213
|
}
|
213
214
|
|
214
215
|
SEPARATORS = {
|
@@ -219,9 +220,10 @@ module DwcAgent
|
|
219
220
|
"(\\S{1}\\.)([[:alpha:]]{2,})" => "\\1 \\2",
|
220
221
|
"^([[:alpha:]]{2,})(?:\\s+)((?:\\S{1}\\.\\s?){1,})$" => "\\1, \\2",
|
221
222
|
"([[:alpha:]]*),?\\s*(.*)\\s+(van|von|v\\.|v(a|o)n\\s+der?)$" => "\\3 \\1, \\2",
|
222
|
-
"^([A-Z
|
223
|
-
"^([A-Z
|
224
|
-
"^([A-Z
|
223
|
+
"^((?i:[A-Z]\\.\\s?){1,})\\s?(?:and|&|et|e)\\s+((?i:[A-Z]\\.\\s?){1,})\\s+([[:alpha:]’`'-]{2,})\\s+([[:alpha:]’`'-]{2,})$" => "\\1 \\4 | \\2 \\3 \\4",
|
224
|
+
"^((?i:[A-Z]\\.\\s?){1,})\\s?(?:and|&|et|e)\\s+((?i:[A-Z]\\.\\s?){1,})\\s+([[:alpha:]’`'-]{2,})(.*)$" => "\\1 \\3 | \\2 \\3 | \\4",
|
225
|
+
"^([A-Z]{1,3})\\s+(?:and|&|et|e)\\s+([A-Z]{1,3})\\s+([[:alpha:]’`'-]{2,})(.*)$" => "\\1 \\3 | \\2 \\3 | \\4",
|
226
|
+
"^((?i:[A-Z]\\.\\s?){1,}),\\s+([A-Z.\\s]+)\\s+(?:and|&|et|e)\\s+((?i:[A-Z]\\.\\s?){1,})\\s+([[:alpha:]’`'-]{2,})(.*)$" => "\\1 \\4 | \\2 \\4 | \\3 \\4 | \\5",
|
225
227
|
"^([A-Z][[:alpha:]]{2,}),\\s*?([A-Z][[:alpha:]]{2,})\\s*?(?i:and|&|et|e|,)\\s+([A-Z][[:alpha:]]{2,})$" => "\\1 | \\2 | \\3",
|
226
228
|
"^([A-Z][[:alpha:]]{2,}),\\s*?([A-Z][[:alpha:]]{2,}),\\s*?([A-Z][[:alpha:]]{2,})\\s*?(?i:and|&|et|e|,)\\s+([A-Z][[:alpha:]]{3,})$" => "\\1 | \\2 | \\3 | \\4",
|
227
229
|
"^([A-Z][[:alpha:]]{2,}),\\s*?([A-Z][[:alpha:]]{2,}),\\s*?([A-Z][[:alpha:]]{2,}),\\s*?([A-Z][[:alpha:]]{2,})\\s*?(?i:and|&|et|e|,)\\s+([A-Z][[:alpha:]]{3,})$" => "\\1 | \\2 | \\3 | \\4 | \\5"
|
@@ -300,6 +302,18 @@ module DwcAgent
|
|
300
302
|
^\s*?de\s*?$
|
301
303
|
}x
|
302
304
|
|
305
|
+
FAMILY_GREENLIST = [
|
306
|
+
"Ng",
|
307
|
+
"Srb",
|
308
|
+
"Srp",
|
309
|
+
"Vlk",
|
310
|
+
"Smrz",
|
311
|
+
"Smrž",
|
312
|
+
"Smrt",
|
313
|
+
"Krc",
|
314
|
+
"Krč"
|
315
|
+
]
|
316
|
+
|
303
317
|
FAMILY_BLACKLIST = [
|
304
318
|
"a b",
|
305
319
|
"a e",
|
@@ -402,4 +416,6 @@ module DwcAgent
|
|
402
416
|
"von der"
|
403
417
|
]
|
404
418
|
|
419
|
+
VOWELS = "aeiouäèéêëìíôöü"
|
420
|
+
|
405
421
|
end
|
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: 3.0.
|
4
|
+
version: 3.0.19.0
|
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: 2024-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: namae
|