dwc_agent 1.5.0.5 → 1.5.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/cleaner.rb +5 -5
- data/lib/dwc_agent/constants.rb +35 -10
- data/lib/dwc_agent/version.rb +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b4adb16325e2c9ac0cd8ed23eb0c9455632d447b942c765af5fb1876b821ab1
|
4
|
+
data.tar.gz: f9890ec976e2626700939134fc7f5ba3b5a5dea6eae94cea3f39579b208e2ee8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b9f1998b5edb9d6c5931e2fc1b87c46078875ac9715979f6ae0a7924f08c78731b05ead538c832d32f3e6025c102f18fa575a875186fdd9207f9bbc78f1c16c
|
7
|
+
data.tar.gz: 451672cdf4a81718096534247d46e73c3bf56770b646e0b67ea401d8e194c7acf21edfd7f2223acd0d75def6fe9848734f891be3d67a93fe277af94d69fbc192
|
data/lib/dwc_agent/cleaner.rb
CHANGED
@@ -18,10 +18,6 @@ module DwcAgent
|
|
18
18
|
def clean(parsed_namae)
|
19
19
|
blank_name = { title: nil, appellation: nil, given: nil, particle: nil, family: nil, suffix: nil }
|
20
20
|
|
21
|
-
if parsed_namae.family && FAMILY_BLACKLIST.any?{ |s| s.casecmp(parsed_namae.family) == 0 }
|
22
|
-
return blank_name
|
23
|
-
end
|
24
|
-
|
25
21
|
if parsed_namae.given && GIVEN_BLACKLIST.any?{ |s| s.casecmp(parsed_namae.given) == 0 }
|
26
22
|
return blank_name
|
27
23
|
end
|
@@ -79,6 +75,10 @@ module DwcAgent
|
|
79
75
|
parsed_namae.given = NameCase(parsed_namae.given)
|
80
76
|
end
|
81
77
|
|
78
|
+
if parsed_namae.family && FAMILY_BLACKLIST.any?{ |s| s.casecmp(parsed_namae.family) == 0 }
|
79
|
+
return blank_name
|
80
|
+
end
|
81
|
+
|
82
82
|
parsed_namae.normalize_initials
|
83
83
|
|
84
84
|
family = parsed_namae.family.gsub(/\.\z/, '').strip rescue nil
|
@@ -114,7 +114,7 @@ module DwcAgent
|
|
114
114
|
return blank_name
|
115
115
|
end
|
116
116
|
|
117
|
-
if !family.nil? && family.match(/^[A-Z]{2}/)
|
117
|
+
if given.nil? && !family.nil? && family.match(/^[A-Z]{2}/)
|
118
118
|
return blank_name
|
119
119
|
end
|
120
120
|
|
data/lib/dwc_agent/constants.rb
CHANGED
@@ -3,6 +3,7 @@ module DwcAgent
|
|
3
3
|
^[\[{(]|
|
4
4
|
[\]})]\??$|
|
5
5
|
(?i:acc\s?\#)|
|
6
|
+
[,;]?\s*(?i:1st|2nd|3rd|[4-9]th)|
|
6
7
|
\s*?\d+\.\d+|
|
7
8
|
\b\d+\(?(?i:[[:alpha:]])\)?\b|
|
8
9
|
\b[,;]?\s*(?i:et\.?\s+al|&\s+al)\.?|
|
@@ -49,34 +50,38 @@ module DwcAgent
|
|
49
50
|
\d+\s+(?i:Oct|Octob(er|re))\.?\b|
|
50
51
|
\d+\s+(?i:Nov|Novemb(er|re))\.?\b|
|
51
52
|
\d+\s+(?i:Dec|D(e|é)cemb(er|re))\.?\b|
|
52
|
-
\b[.-–,;:/]?\s*(?i:Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Evergreen|Florida|
|
53
|
-
\b[.,;:/]?\s*?(?i:Afghanistan|Åland Islands|Albania|Algeria|American Samoa|Andorra|Angola|Anguilla|Antarctica|Antigua and Barbuda|Argentina|Armenia|Aruba|Australia|Austria|Azerbaijan|Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Belgium|Belize|Benin|Bermuda|Bhutan|Bolivia \(Plurinational State of\)|Bonaire, Sint Eustatius and Saba|Bosnia and Herzegovina|Botswana|Bouvet Island|Brazil|British Indian Ocean Territory|Brunei Darussalam|Bulgaria|Burkina Faso|Burundi|Cabo Verde|Cambodia|Cameroon|Canada|Cayman Islands|Central African Republic|Chad|Chile|China|Christmas Island|Cocos \(Keeling\) Islands|Colombia|Comoros|Congo|Congo \(Democratic Republic of the\)|Cook Islands|Costa Rica|Côte d'Ivoire|Croatia|Cuba|Curaçao|Cyprus|Czechia|Denmark|Djibouti|Dominica|Dominican Republic|Ecuador|Egypt|El Salvador|Equatorial Guinea|Eritrea|Estonia|Ethiopia|Falkland Islands \(Malvinas\)|Faroe Islands|Fiji|Finland|France|French Guiana|French Polynesia|French Southern Territories|Gabon|Gambia|
|
53
|
+
\b[.-–,;:/]?\s*(?i:Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Evergreen|Florida|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New\s+Hampshire|New\s+Jersey|New\s+Mexico|New\s+York|North\s+Carolina|North\s+Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Portland|Rhode\s+Island|South\s+Carolina|South\s+Dakota|St\s+Petersburg|Tennessee|Texas|Utah|Vermont|Washington|West\s+Virginia|Wisconsin|Wyoming)\s+(?i:State)\s*\b|
|
54
|
+
\b[.,;:/]?\s*?(?i:Afghanistan|Åland Islands|Albania|Algeria|American Samoa|Andorra|Angola|Anguilla|Antarctica|Antigua and Barbuda|Argentina|Armenia|Aruba|Australia|Austria|Azerbaijan|Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Belgium|Belize|Benin|Bermuda|Bhutan|Bolivia \(Plurinational State of\)|Bonaire, Sint Eustatius and Saba|Bosnia and Herzegovina|Botswana|Bouvet Island|Brazil|British Indian Ocean Territory|Brunei Darussalam|Bulgaria|Burkina Faso|Burundi|Cabo Verde|Cambodia|Cameroon|Canada|Cayman Islands|Central African Republic|Chad|Chile|China|Christmas Island|Cocos \(Keeling\) Islands|Colombia|Comoros|Congo|Congo \(Democratic Republic of the\)|Cook Islands|Costa Rica|Côte d'Ivoire|Croatia|Cuba|Curaçao|Cyprus|Czechia|Denmark|Djibouti|Dominica|Dominican Republic|Ecuador|Egypt|El Salvador|Equatorial Guinea|Eritrea|Estonia|Ethiopia|Falkland Islands \(Malvinas\)|Faroe Islands|Fiji|Finland|France|French Guiana|French Polynesia|French Southern Territories|Gabon|Gambia|Germany|Ghana|Gibraltar|Greece|Greenland|Grenada|Guadeloupe|Guam|Guatemala|Guernsey|Guinea|Guinea-Bissau|Guyana|Haiti|Heard Island and McDonald Islands|Holy See|Honduras|Hong Kong|Hungary|Iceland|India|Indonesia|Iran \(Islamic Republic of\)|Iraq|Ireland|Isle of Man|Israel|Italy|Jamaica|Japan|Jersey|Kazakhstan|Kenya|Kiribati|Korea \(Democratic People\'s Republic of\)|Korea \(Republic of\)|Kuwait|Kyrgyzstan|Lao People\'s Democratic Republic|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luxembourg|Macao|Macedonia (the former Yugoslav Republic of)|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Marshall Islands|Martinique|Mauritania|Mauritius|Mayotte|Mexico|Micronesia \(Federated States of\)|Moldova \(Republic of\)|Monaco|Mongolia|Montenegro|Montserrat|Morocco|Mozambique|Myanmar|Namibia|Nauru|Nepal|Netherlands|New Caledonia|New Zealand|Nicaragua|Niger|Nigeria|Niue|Norfolk Island|Northern Mariana Islands|Norway|Oman|Pakistan|Palau|Palestine, State of|Panama|Papua New Guinea|Paraguay|Peru|Philippines|Pitcairn|Poland|Portugal|Puerto Rico|Qatar|Réunion|Romania|Russian Federation|Rwanda|Saint Barthélemy|Saint Helena, Ascension and Tristan da Cunha|Saint Kitts and Nevis|Saint Lucia|Saint Martin \(French part\)|Saint Pierre and Miquelon|Saint Vincent and the Grenadines|Samoa|San Marino|Sao Tome and Principe|Saudi Arabia|Senegal|Serbia|Seychelles|Sierra Leone|Singapore|Sint Maarten \(Dutch part\)|Slovakia|Slovenia|Solomon Islands|Somalia|South Africa|South Georgia and the South Sandwich Islands|South Sudan|Spain|Sri Lanka|Sudan|Suriname|Svalbard and Jan Mayen|Swaziland|Sweden|Switzerland|Syrian Arab Republic|Taiwan|Tajikistan|Tanzania, United Republic of|Thailand|Timor-Leste|Togo|Tokelau|Tonga|Trinidad and Tobago|Tunisia|Turkey|Turkmenistan|Turks and Caicos Islands|Tuvalu|Uganda|Ukraine|United Arab Emirates|United Kingdom of Great Britain and Northern Ireland|United States of America|United States Minor Outlying Islands|Uruguay|Uzbekistan|Vanuatu|Venezuela \(Bolivarian Republic of\)|Viet Nam|Virgin Islands \(British\)|Virgin Islands \(U\.S\.\)|Wallis and Futuna|Western Sahara|Yemen|Zambia|Zimbabwe)\b|
|
54
55
|
(?i:autres?\s+de|probab|likely|possibl(e|y)|doubtful)|
|
55
56
|
\b\s*(?i:maybe)\s*\b|
|
56
57
|
\b\s*(?i:prob)\.\s*\b|
|
57
|
-
\(?[,]?\s*?(?i:(local)?\s?
|
58
|
+
\(?[,]?\s*?(?i:(local)?\s?collectors?|data\s*recorder|netter|(oper|prepar)ator)\(?s?\)?\.?\:?|
|
58
59
|
\b[.-–,;:]?\s*(?i:department|faculty)\s*?(?i:of)?\s*?(?i:entomology|biology|zoology)|
|
59
60
|
(?i:Engº|Agrº|Fcº|Drº|Mº|Profº|Dº|Fº)|
|
60
61
|
(?i:fide)\:?\s*\b|
|
62
|
+
(?i:first\s+name\s+unknown)|
|
61
63
|
(?i:game\s+dept)\.?\s*\b|
|
62
64
|
(?i:see\s+notes?\s*(inside)?)|
|
63
65
|
(?i:see\s+letter\s+enclosed)|
|
64
66
|
(?i:(by)?\s+correspondance)|
|
65
67
|
(?i:pers\.?\s*comm\.?)|
|
66
68
|
(?i:crossed\s+out)|
|
69
|
+
(?i:(ohne|keine)\s+angaben)|
|
67
70
|
\(?(?i:source)\(?|
|
68
71
|
(?i:according\s+to)|
|
69
72
|
(?i:lanuv)\d+|
|
73
|
+
\b\s*name\b|
|
74
|
+
\b\s*lost\b|
|
70
75
|
(?i:nswobs)|
|
71
76
|
ORCID|
|
72
77
|
MRI(\s|-)PAS|
|
73
78
|
urn\:qm\.qld\.gov\.au\:collector|
|
74
79
|
(?i:University\s+of\s+(Southern\s+)?California(,\s+Berkeley)?)|
|
75
|
-
(?i:
|
76
|
-
(?i:
|
80
|
+
(?i:field\s+museum\s+of\s+natural\s+history)|
|
81
|
+
(?i:american\s+museum\s+of\s+natural\s+history)|
|
77
82
|
(?i:The\s+Paleontological\s+Research\s+Institution)|
|
78
83
|
(?i:museums?\s+victoria)|
|
79
|
-
\b\s*(?i:
|
84
|
+
\b\s*(?i:united\s+states|russia)\s*\b|
|
80
85
|
(?i:revised|photograph|fruits\s+only)|
|
81
86
|
-?\s*(?i:sight\s+(id|identifi?cation))\.?\s*\b|
|
82
87
|
-?\s*(?i:synonym(y|ie))|
|
@@ -106,11 +111,14 @@ module DwcAgent
|
|
106
111
|
(\(|\[|\{).{1,}\z|
|
107
112
|
\b(?i:leg)[\.:]?\s*\b|
|
108
113
|
(?i:ded)\:|
|
114
|
+
\d*[A-Za-z]*\d*-\d*\z|
|
115
|
+
\s+[A-Z]*\d+\z|
|
116
|
+
\s+\d+[A-Za-z]+\z|
|
109
117
|
^[-,.\s;*\d]+\s?|
|
110
|
-
-\d?\z|
|
111
118
|
\s*?-{2,}\s*?|
|
112
119
|
^(?i:exc?p?)[:.]\s*|
|
113
|
-
\s+de\s
|
120
|
+
\s+de\s*$|
|
121
|
+
\.{2,}$
|
114
122
|
}x
|
115
123
|
|
116
124
|
SPLIT_BY = %r{
|
@@ -244,7 +252,7 @@ module DwcAgent
|
|
244
252
|
(?i:though)|
|
245
253
|
(?i:texas\s+instruments?)\s*?(for)?|
|
246
254
|
(?:tropical)|
|
247
|
-
(?i:toward|seen
|
255
|
+
(?i:toward|seen\s+at)|
|
248
256
|
(?i:unidentified|unspecified|unk?nown?|unnamed|unread|unmistak|no agent)|
|
249
257
|
(?i:urn\:)|
|
250
258
|
(?i:usda|ucla)|
|
@@ -253,30 +261,47 @@ module DwcAgent
|
|
253
261
|
}x
|
254
262
|
|
255
263
|
FAMILY_BLACKLIST = [
|
264
|
+
"ap",
|
256
265
|
"da",
|
266
|
+
"de",
|
257
267
|
"de'",
|
258
268
|
"del",
|
259
269
|
"der",
|
270
|
+
"di",
|
271
|
+
"do",
|
272
|
+
"dos",
|
260
273
|
"du",
|
261
274
|
"el",
|
275
|
+
"le",
|
276
|
+
"la",
|
262
277
|
"van",
|
263
278
|
"von",
|
264
279
|
"the",
|
265
280
|
"of",
|
266
281
|
"adjustment",
|
282
|
+
"annotator",
|
267
283
|
"available",
|
268
284
|
"arachnology",
|
269
285
|
"catalogue",
|
270
286
|
"curators",
|
271
287
|
"data",
|
288
|
+
"details",
|
289
|
+
"determiner",
|
272
290
|
"determination",
|
273
291
|
"dissection",
|
274
292
|
"entered",
|
293
|
+
"erased",
|
275
294
|
"indecipherable",
|
276
295
|
"nomenclatural",
|
277
296
|
"orig",
|
278
297
|
"registration",
|
279
|
-
"science"
|
298
|
+
"science",
|
299
|
+
"wg",
|
300
|
+
"wm",
|
301
|
+
"wn",
|
302
|
+
"zw",
|
303
|
+
"zz",
|
304
|
+
"z-"
|
280
305
|
]
|
281
306
|
|
282
307
|
GIVEN_BLACKLIST = [
|
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.0
|
4
|
+
version: 1.5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David P. Shorthouse
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: namae
|
@@ -102,7 +102,7 @@ homepage: https://github.com/bionomia/dwc_agent
|
|
102
102
|
licenses:
|
103
103
|
- MIT
|
104
104
|
metadata: {}
|
105
|
-
post_install_message:
|
105
|
+
post_install_message:
|
106
106
|
rdoc_options:
|
107
107
|
- "--encoding"
|
108
108
|
- UTF-8
|
@@ -112,15 +112,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
112
|
requirements:
|
113
113
|
- - "~>"
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: '2.
|
115
|
+
version: '2.7'
|
116
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
118
|
- - ">="
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
123
|
-
signing_key:
|
122
|
+
rubygems_version: 3.1.2
|
123
|
+
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Parse Darwin Core agent terms such as recordedBy and identifiedBy
|
126
126
|
test_files: []
|