bpl_enrich 0.0.4 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24056054658a8d9d667528ba090aebc960d9f56d
4
- data.tar.gz: 5310a03d3ee67c6a5624a5b82c7f4258dd4a6566
3
+ metadata.gz: 95cfb975117e1f8ee56d5a6ee1f29fe1f4f8e287
4
+ data.tar.gz: 61b8b2b2d49513198c468067064483f866802af1
5
5
  SHA512:
6
- metadata.gz: 96b045011afcbc111031d23e5fc1f8f92b4cbf915504af2a59505c7e0abaae8b18d521245c3ec01c20d0363c05d77f474448f8fb6f8e0578faad93fe5ddc2130
7
- data.tar.gz: 383170db59cc35c19f1b093a6dc2c5542457f3204ba9e2feb3b098fece16c94705d5514b6c31eee43a28706fa489ac7e664e002cd9c7383560a6419ace2c0305
6
+ metadata.gz: dfb47e5ad134b9a5e39560ab506ca8951d23cc4fbf60134f5d6e98f237ffba18e5b905a8a17fb6e37c940cd1e813489ec7128068c9680fd37d4cc9bd717568b5
7
+ data.tar.gz: 3efa54d7b3c4cff78cefbc395e03628433b9aeef66d5b6476ea5cd5d4ed2da69f5f72f51077d0cafbed47027346f29511fb5f49214fab75f14ab5923fc7e59ca
@@ -71,7 +71,7 @@ module BplEnrich
71
71
 
72
72
  # remove unnecessary chars and words
73
73
  value = value.gsub(/[\[\]\(\)\.,']/,'')
74
- value = value.gsub(/(\b[Bb]etween\b|\bcirca\b|\bca\b|\Aca|\Ac)/,'').strip
74
+ value = value.gsub(/(\b[Bb]etween\b|\b[Cc]irca\b|\bca\b|\Aca|\Ac)/,'').strip
75
75
 
76
76
  # differentiate between ranges and single dates
77
77
  if (value.scan(/\d\d\d\d/).length == 2) ||
@@ -1,3 +1,3 @@
1
1
  module BplEnrich
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/test/dates_test.rb CHANGED
@@ -52,6 +52,13 @@ class DatesTest < ActiveSupport::TestCase
52
52
  assert_equal nil, result[:date_range]
53
53
  assert_equal nil, result[:date_note]
54
54
  assert_equal 'questionable', result[:date_qualifier]
55
+
56
+ result = BplEnrich::Dates.standardize('Circa 2000')
57
+ assert_equal '2000', result[:single_date]
58
+ assert_equal nil, result[:date_range]
59
+ assert_equal nil, result[:date_note]
60
+ assert_equal 'approximate', result[:date_qualifier]
61
+ assert_equal nil, result[:date_note]
55
62
  end
56
63
 
57
64
 
@@ -176,5 +176,35 @@ BplEnrichTest: test_strip_value
176
176
   (0.0ms) begin transaction
177
177
  ---------------------------------
178
178
  DatesTest: test_date_standardizer
179
+ ---------------------------------
180
+  (0.0ms) rollback transaction
181
+  (0.0ms) begin transaction
182
+ --------------------------------
183
+ LCSHTest: test_lcsh_standardizer
184
+ --------------------------------
185
+  (0.0ms) rollback transaction
186
+  (0.0ms) begin transaction
187
+ ------------------------------------
188
+ AuthoritiesTest: test_parse_language
189
+ ------------------------------------
190
+  (0.1ms) rollback transaction
191
+  (0.1ms) begin transaction
192
+ -----------------------------------------
193
+ AuthoritiesTest: test_parse_name_for_role
194
+ -----------------------------------------
195
+  (0.1ms) rollback transaction
196
+  (0.0ms) begin transaction
197
+ --------------------------------
198
+ AuthoritiesTest: test_parse_role
199
+ --------------------------------
200
+  (0.1ms) rollback transaction
201
+  (0.0ms) begin transaction
202
+ -------------------------------
203
+ BplEnrichTest: test_strip_value
204
+ -------------------------------
205
+  (0.0ms) rollback transaction
206
+  (0.0ms) begin transaction
207
+ ---------------------------------
208
+ DatesTest: test_date_standardizer
179
209
  ---------------------------------
180
210
   (0.0ms) rollback transaction
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bpl_enrich
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boston Public Library
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2016-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails