dwc_agent 1.4.4 → 1.4.5
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 +7 -6
- data/lib/dwc_agent/parser.rb +4 -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: 7b8890828a04d30f7989f3545df032be216d1bab086f1ec6576cbe93569231bd
|
|
4
|
+
data.tar.gz: d94e120615540e65f29a13132d46b34639e3380e2265439fd05cf5febc580ff6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2e30d42a8c2d743791c2322a51d3fe022e5ef458f68ebd30763cfc74e5ec9a1914faca1ff90cfb3364bead66cde22bccbc0ab47aef6a7d17a78c6954c8cbeff
|
|
7
|
+
data.tar.gz: d2de0c26c64f77fd273db67465d8772aef5480eb0c4dd1b48446dbb6a6495164bc9e2fbd133280c18ef7e975f82bf9f46dcd65e87727531fa7c514ebc09e0be7
|
data/lib/dwc_agent/constants.rb
CHANGED
|
@@ -15,7 +15,6 @@ module DwcAgent
|
|
|
15
15
|
\b[,;]?\s*(?i:ann?onymous)\b|
|
|
16
16
|
\b[,;]?\s*\(?(?i:undetermined|indeterminable|dummy|interim|accession|ill(eg|is)ible|scripsit)\)?\b|
|
|
17
17
|
\b[,;]?\s*(?i:importer|gift)\:?\b|
|
|
18
|
-
\b[,;]?\s*(?i:frère|frere|père|pere|soeur|sister|bro)\.?(\b|\z)|
|
|
19
18
|
\b[,;]?\s*(?i:string)\b|
|
|
20
19
|
\b[,;]?\s*(?i:person\s*string)\b|
|
|
21
20
|
\b[,;]?\s*(?i:colls)\.(\b|\z)|
|
|
@@ -154,10 +153,12 @@ module DwcAgent
|
|
|
154
153
|
}
|
|
155
154
|
|
|
156
155
|
PHRASE_SUBS = {
|
|
157
|
-
'
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
'
|
|
156
|
+
'dr\.' => 'Dr. ',
|
|
157
|
+
'mr\.' => 'Mr. ',
|
|
158
|
+
'mrs\.' => 'Mrs. ',
|
|
159
|
+
'prof\.' => 'Prof. ',
|
|
160
|
+
'\, ph\.d\.' => ' Ph.D.',
|
|
161
|
+
'\, bro\.' => ' Bro.'
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
COMPLEX_SEPARATORS = %r{
|
|
@@ -258,6 +259,6 @@ module DwcAgent
|
|
|
258
259
|
"has not"
|
|
259
260
|
]
|
|
260
261
|
|
|
261
|
-
TITLE = /\s*\b(sir|count(ess)?|(gen|adm|col|maj|capt|cmdr|lt|sgt|cpl|pvt|prof|dr|md|ph\.?d|rev|
|
|
262
|
+
TITLE = /\s*\b(sir|count(ess)?|(gen|adm|col|maj|capt|cmdr|lt|sgt|cpl|pvt|prof|dr|md|ph\.?d|rev|mme|abbé|ptre|bro|esq)\.?|docteur|father|cantor|vicar|père|pastor|rabbi|reverend|pere|soeur|sister|professor)(\s+|$)/i
|
|
262
263
|
|
|
263
264
|
end
|
data/lib/dwc_agent/parser.rb
CHANGED
|
@@ -8,7 +8,7 @@ module DwcAgent
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def initialize
|
|
11
|
-
options = {
|
|
11
|
+
options = {
|
|
12
12
|
prefer_comma_as_separator: true,
|
|
13
13
|
separator: SPLIT_BY,
|
|
14
14
|
title: TITLE
|
|
@@ -18,11 +18,11 @@ module DwcAgent
|
|
|
18
18
|
@strip_out_regex = Regexp.new STRIP_OUT.to_s
|
|
19
19
|
@residual_terminators_regex = Regexp.new SPLIT_BY.to_s + %r{\s*\z}.to_s
|
|
20
20
|
@char_subs_regex = Regexp.new [CHAR_SUBS.keys.join].to_s
|
|
21
|
-
@phrase_subs_regex = Regexp.new
|
|
21
|
+
@phrase_subs_regex = Regexp.new((PHRASE_SUBS.keys.join('|')).to_s, Regexp::IGNORECASE)
|
|
22
22
|
@complex_separators_regex = Regexp.new COMPLEX_SEPARATORS.to_s
|
|
23
23
|
@add_separators_regex = Regexp.new %r{(\S{1}\.)([[:alpha:]]{2,})}.to_s
|
|
24
24
|
end
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
# Parses the passed-in string and returns a list of names.
|
|
27
27
|
#
|
|
28
28
|
# @param names [String] the name or names to be parsed
|
|
@@ -42,4 +42,4 @@ module DwcAgent
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
end
|
|
45
|
-
end
|
|
45
|
+
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: 1.4.
|
|
4
|
+
version: 1.4.5
|
|
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: 2020-01-
|
|
11
|
+
date: 2020-01-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: namae
|