dwc_agent 1.0.0 → 1.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69d6e0f6c0f9d59801d0e53a89dd73896f0ac5a8230156879227ea6efe14bb7d
4
- data.tar.gz: 1330921589cbcad22273c4b5cae821eba7266cc4357756498ae3b6d4f029e3f8
3
+ metadata.gz: e2819869504dd7262508c63978dae9b03cd6380838bf20f1e5ffecb8464b610a
4
+ data.tar.gz: 3d1afff77e4bea9995cec5a3f72687646cdb6c9f7637bef8444f7a45df4ab556
5
5
  SHA512:
6
- metadata.gz: 735057f853b259f4d7fcb9f4c73d2f193f9a0e363d439a8bf894bbd9f878e8667cd14979c10cf138c7cc007f83cd09b7d5f9f21e0482b6303f73a40c788a957a
7
- data.tar.gz: 8760dc0d9976543fe6ce448e2129b94e2d86d5a17f8e0b4b297f4dd23e8c4e4d73b4c7af4863e5edfa6abbbdb83181e6364e8064b0c73f185b0370c3ea1f597c
6
+ metadata.gz: 223cdf7a80a54e102da1f35d0b98d420d5a3b4ca1a11494ac3feca73a80d86f83a092b3c8b5dac1e5079a56cb5c69c3771876a091770cb4c9e45de0fc905d177
7
+ data.tar.gz: 042d702364e285c9e629180802ecd2f1898af1c50ec6fbdcacefa8f117d734db7843fd17e0f816771fcef47c7839ccfa8014d963f6798eaec25e7a3854b88289
data/bin/dwcagent CHANGED
@@ -5,7 +5,7 @@ require 'dwc_agent'
5
5
  require 'json'
6
6
 
7
7
  names = []
8
- DwcAgent.parse(ARGV[0]).each do |r|
8
+ DwcAgent.parse(ARGV[0].dup).each do |r|
9
9
  name = DwcAgent.clean(r)
10
10
  if !name[:family].nil? && name[:family].length >= 2
11
11
  names << name
@@ -3,4 +3,4 @@
3
3
 
4
4
  require 'dwc_agent'
5
5
 
6
- puts DwcAgent.similarity_score(ARGV[0],ARGV[1])
6
+ puts DwcAgent.similarity_score(ARGV[0].dup,ARGV[1].dup)
@@ -22,10 +22,6 @@ module DwcAgent
22
22
  return blank_name
23
23
  end
24
24
 
25
- if parsed_namae.family && parsed_namae.family.length < 2 && parsed_namae.family.count('.') == 0
26
- return blank_name
27
- end
28
-
29
25
  if parsed_namae.family && parsed_namae.family.length == 3 && parsed_namae.family.count('.') == 1
30
26
  return blank_name
31
27
  end
@@ -159,7 +159,7 @@ module DwcAgent
159
159
  }
160
160
 
161
161
  COMPLEX_SEPARATORS = %r{
162
- ^([A-Za-z]{4,},\s+(?:[A-Z]\.\s*){1,})\s+([A-Za-z]{4,},\s+(?:[A-Z]\.\s*){1,})$
162
+ ^(\S{4,},\s+(?:\S\.\s*){1,})\s+(\S{4,},\s+(?:\S\.\s*){1,})$
163
163
  }x
164
164
 
165
165
  BLACKLIST = %r{
@@ -198,11 +198,13 @@ module DwcAgent
198
198
  (?i:no\s+(agent)?\s?(data|disponible)(\s+available)?)|
199
199
  (?i:not?\s+(entered|stated))|
200
200
  (?i:nomenclatur(e|al)\s+adjustment)|
201
+ (?i:not\s+available)|
201
202
  (?i:ontario|qu(e|é)bec|saskatchewan|new brunswick|sault|newfoundland|assurance|vancouver|u\.?s\.?s\.?r\.?)|
202
203
  (?i:recreation|culture)|
203
204
  (?i:shaped|dark|pale|areas|phase|spotting|interior|between|closer)|
204
205
  (?i:soci(e|é)t(y|é)|cent(er|re)|community|history|conservation|conference|assoc|class|commission|consortium|council|club|exposit|alliance|protective|circle)|
205
206
  (?i:commercial|company|control|product)|
207
+ (?i:sequence\s+data)|
206
208
  (?i:size|large|colou?r)\s+|
207
209
  (?i:skeleton)|
208
210
  (?i:survey|assessment|station|monitor|stn\.|index|project|bureau|engine|exchange|ex(c|k)ursi(e|o|ó)n?|exped\.?|exp(e|i)di(c|t)i(e|o|ó)n?|experiment|explora(d|t)|festival|generation|inventory|marine|service)|
@@ -213,6 +215,7 @@ module DwcAgent
213
215
  \s*(?i:too)\s+|\s*(?i:the)\s+|
214
216
  (?i:taxiderm(ies|y))|
215
217
  (?i:though)|
218
+ (?i:texas\s+instruments?)\s*?(for)?|
216
219
  (?:tropical)|
217
220
  (?i:toward|seen at)|
218
221
  (?i:unidentified|unspecified|unk?nown|unnamed|unread|unmistak|no agent)|
@@ -230,7 +233,12 @@ module DwcAgent
230
233
  "of",
231
234
  "curators",
232
235
  "nomenclatural",
233
- "adjustment"
236
+ "adjustment",
237
+ "available",
238
+ "data",
239
+ "orig",
240
+ "science",
241
+ "catalogue"
234
242
  ]
235
243
 
236
244
  TITLE = /\s*\b(sir|count(ess)?|(gen|adm|col|maj|capt|cmdr|lt|sgt|cpl|pvt|prof|dr|md|ph\.?d|rev|docteur|mme|abbé|ptre)\.?|frère|frere|père|pere|professor|esq\.?)(\s+|$)/i
@@ -20,7 +20,7 @@ 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{([A-Z]{1}\.)([[:alpha:]]{2,})}.to_s
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.
@@ -2,8 +2,8 @@ module DwcAgent
2
2
  class Version
3
3
 
4
4
  MAJOR = 1
5
- MINOR = 0
6
- PATCH = 0
5
+ MINOR = 4
6
+ PATCH = 1
7
7
  BUILD = nil
8
8
 
9
9
  def self.version
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.0.0
4
+ version: 1.4.1
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-09-29 00:00:00.000000000 Z
11
+ date: 2019-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: namae