dwc_agent 0.1.13 → 0.1.14
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 +6 -3
- data/lib/dwc_agent/parser.rb +2 -1
- data/lib/dwc_agent/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 894f3ba7e672cd036415517d23de66330f384c4c
|
|
4
|
+
data.tar.gz: 1224793c2f94a1703cb845d820df67f4f664ea9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5726e6965eeb0443223a84dc2a2415cdb076401c2a60bbf766780142b10c5546a6fd7f02ccf9dfb5942586facacdb7d61b0f28c7ee023d37139adba18205b4d1
|
|
7
|
+
data.tar.gz: 59a1ab9fec406001648f07db99e3ce212a5f0dcdf0ccb21e11c3ea3d87617fa1368288ac22d5ac0d87f48359c686b23b3df43d8525cb45a6b02b4cdb5893ef8f
|
data/lib/dwc_agent/constants.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
module DwcAgent
|
|
2
2
|
STRIP_OUT = %r{
|
|
3
|
+
\s*?\d+\.\d+|
|
|
3
4
|
\b\d+\(?(?i:[[:alpha:]])\)?\b|
|
|
4
5
|
\b[,;]?\s*(?i:et\s+al)\.?|
|
|
5
6
|
\bu\.\s*a\.|
|
|
@@ -75,10 +76,12 @@ module DwcAgent
|
|
|
75
76
|
(?i:annot\.?)\b|
|
|
76
77
|
\s+(?i:stet)\s*!?\s*\z|
|
|
77
78
|
\s+(?i:prep)\.?\s*\z|
|
|
78
|
-
\(.{1,}\)|
|
|
79
|
-
\(.{1,}\z|
|
|
79
|
+
(\(|\{|\[).{1,}(\)|\]|\})|
|
|
80
|
+
(\(|\[|\{).{1,}\z|
|
|
80
81
|
\b(?i:leg)[\.:]?\s*\b|
|
|
81
|
-
(?i:ded)
|
|
82
|
+
(?i:ded)\:|
|
|
83
|
+
^[-,.\s\;*\d]{1,}|
|
|
84
|
+
-\d?\z
|
|
82
85
|
}x
|
|
83
86
|
|
|
84
87
|
SPLIT_BY = %r{
|
data/lib/dwc_agent/parser.rb
CHANGED
|
@@ -13,11 +13,12 @@ module DwcAgent
|
|
|
13
13
|
# @return [Array] the list of parsed names
|
|
14
14
|
def parse(name)
|
|
15
15
|
return [] if name.nil? || name == ""
|
|
16
|
+
residual_terminators_regex = Regexp.new SPLIT_BY.to_s + %r{\s*\z}.to_s
|
|
16
17
|
cleaned = name.gsub(STRIP_OUT, ' ')
|
|
17
18
|
.gsub(/[#{CHAR_SUBS.keys.join('\\')}]/, CHAR_SUBS)
|
|
18
19
|
.gsub(/([A-Z]{1}\.)([[:alpha:]]{2,})/, '\1 \2')
|
|
19
20
|
.gsub(COMPLEX_SEPARATORS, '\1 | \2')
|
|
20
|
-
.gsub(
|
|
21
|
+
.gsub(residual_terminators_regex, '')
|
|
21
22
|
.squeeze(' ').strip
|
|
22
23
|
options = {
|
|
23
24
|
prefer_comma_as_separator: true,
|
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: 0.1.
|
|
4
|
+
version: 0.1.14
|
|
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-01-
|
|
11
|
+
date: 2019-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: namae
|