dwc_agent 1.0.0 → 1.1.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/constants.rb +5 -1
- data/lib/dwc_agent/parser.rb +3 -1
- 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: d56e8cb49d4857e324dbdda7d6cfa31e9a7a3079c40a12659ff6077d13308613
|
|
4
|
+
data.tar.gz: 7652bc849261aa4179a99e64a725a0f82d0b65b4d2e2885042ad35521887e705
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 99d384a56c180c8c5db64c5cc8cf072da272b427830875783a22d67279cd070af3bd0bd2b881e4a20018bdeba774d27e8adb8ae048668c28452171017b72c70b
|
|
7
|
+
data.tar.gz: edc59989136745e0b603039d08420b368ef92e95a0ab17b48bcabf439472c1252ec763f4f9c7a398b735995b340f897dc0f3d85a45c2ea1c9ccec643f050e904
|
data/lib/dwc_agent/constants.rb
CHANGED
|
@@ -159,7 +159,11 @@ module DwcAgent
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
COMPLEX_SEPARATORS = %r{
|
|
162
|
-
^(
|
|
162
|
+
^(\S{4,},\s+(?:\S\.\s*){1,})\s+(\S{4,},\s+(?:\S\.\s*){1,})$
|
|
163
|
+
}x
|
|
164
|
+
|
|
165
|
+
CONTRACTED_LIST = %r{
|
|
166
|
+
^(\S{1,}\.?)+\s+(?i:and|&)\s+(\S{1,}\.?)+\s*(.*)$
|
|
163
167
|
}x
|
|
164
168
|
|
|
165
169
|
BLACKLIST = %r{
|
data/lib/dwc_agent/parser.rb
CHANGED
|
@@ -20,7 +20,8 @@ module DwcAgent
|
|
|
20
20
|
@char_subs_regex = Regexp.new [CHAR_SUBS.keys.join('\\')].to_s
|
|
21
21
|
@phrase_subs_regex = Regexp.new (PHRASE_SUBS.keys.join('|')).to_s
|
|
22
22
|
@complex_separators_regex = Regexp.new COMPLEX_SEPARATORS.to_s
|
|
23
|
-
@add_separators_regex = Regexp.new %r{(
|
|
23
|
+
@add_separators_regex = Regexp.new %r{(\S{1}\.)([[:alpha:]]{2,})}.to_s
|
|
24
|
+
@contracted_list_regex = Regexp.new CONTRACTED_LIST.to_s
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
# Parses the passed-in string and returns a list of names.
|
|
@@ -34,6 +35,7 @@ module DwcAgent
|
|
|
34
35
|
name.gsub!(@phrase_subs_regex, PHRASE_SUBS)
|
|
35
36
|
name.gsub!(@add_separators_regex, '\1 \2')
|
|
36
37
|
name.gsub!(@complex_separators_regex, '\1 | \2')
|
|
38
|
+
name.gsub!(@contracted_list_regex, '\1 \3 | \2 \3')
|
|
37
39
|
name.gsub!(@residual_terminators_regex, '')
|
|
38
40
|
name.squeeze!(' ')
|
|
39
41
|
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.
|
|
4
|
+
version: 1.1.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: 2019-
|
|
11
|
+
date: 2019-10-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: namae
|