bpl_enrich 0.0.5 → 0.0.6

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: 95cfb975117e1f8ee56d5a6ee1f29fe1f4f8e287
4
- data.tar.gz: 61b8b2b2d49513198c468067064483f866802af1
3
+ metadata.gz: 69ccce9a084733f7f9fb63c6a26dba0c74818829
4
+ data.tar.gz: e33886a42dcf60f031932f22181cfd82fcb0fa78
5
5
  SHA512:
6
- metadata.gz: dfb47e5ad134b9a5e39560ab506ca8951d23cc4fbf60134f5d6e98f237ffba18e5b905a8a17fb6e37c940cd1e813489ec7128068c9680fd37d4cc9bd717568b5
7
- data.tar.gz: 3efa54d7b3c4cff78cefbc395e03628433b9aeef66d5b6476ea5cd5d4ed2da69f5f72f51077d0cafbed47027346f29511fb5f49214fab75f14ab5923fc7e59ca
6
+ metadata.gz: be415afcc29ca30c9fa7dab438b5a7949dccc22586ae82ad14783c637063e59a14f4da59470454facfcfc3d000cf9c5117ae8e001da9c139a5d598a64e538e5e
7
+ data.tar.gz: ae47de03455d706e6578967f9bb79564911c550e8fc7aa3b77079f28d0b99d62397e94b86d9beb63e11320328760cc7fb05c90803f17755382d29df8f23ac641
@@ -72,6 +72,7 @@ module BplEnrich
72
72
  # remove unnecessary chars and words
73
73
  value = value.gsub(/[\[\]\(\)\.,']/,'')
74
74
  value = value.gsub(/(\b[Bb]etween\b|\b[Cc]irca\b|\bca\b|\Aca|\Ac)/,'').strip
75
+ value = value.gsub(/-00/,'') # 1995-00 || 1995-01-00
75
76
 
76
77
  # differentiate between ranges and single dates
77
78
  if (value.scan(/\d\d\d\d/).length == 2) ||
@@ -1,3 +1,3 @@
1
1
  module BplEnrich
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/test/dates_test.rb CHANGED
@@ -59,6 +59,27 @@ class DatesTest < ActiveSupport::TestCase
59
59
  assert_equal nil, result[:date_note]
60
60
  assert_equal 'approximate', result[:date_qualifier]
61
61
  assert_equal nil, result[:date_note]
62
+
63
+ result = BplEnrich::Dates.standardize('1995-01-00')
64
+ assert_equal '1995-01', result[:single_date]
65
+ assert_equal nil, result[:date_range]
66
+ assert_equal nil, result[:date_note]
67
+ assert_equal nil, result[:date_qualifier]
68
+ assert_equal nil, result[:date_note]
69
+
70
+ result = BplEnrich::Dates.standardize('1996-00-00')
71
+ assert_equal '1996', result[:single_date]
72
+ assert_equal nil, result[:date_range]
73
+ assert_equal nil, result[:date_note]
74
+ assert_equal nil, result[:date_qualifier]
75
+ assert_equal nil, result[:date_note]
76
+
77
+ result = BplEnrich::Dates.standardize('1997-00')
78
+ assert_equal '1997', result[:single_date]
79
+ assert_equal nil, result[:date_range]
80
+ assert_equal nil, result[:date_note]
81
+ assert_equal nil, result[:date_qualifier]
82
+ assert_equal nil, result[:date_note]
62
83
  end
63
84
 
64
85
 
@@ -208,3 +208,33 @@ BplEnrichTest: test_strip_value
208
208
  DatesTest: test_date_standardizer
209
209
  ---------------------------------
210
210
   (0.0ms) rollback transaction
211
+  (0.1ms) begin transaction
212
+ --------------------------------
213
+ LCSHTest: test_lcsh_standardizer
214
+ --------------------------------
215
+  (0.0ms) rollback transaction
216
+  (0.0ms) begin transaction
217
+ ---------------------------------
218
+ DatesTest: test_date_standardizer
219
+ ---------------------------------
220
+  (0.0ms) rollback transaction
221
+  (0.0ms) begin transaction
222
+ -------------------------------
223
+ BplEnrichTest: test_strip_value
224
+ -------------------------------
225
+  (0.0ms) rollback transaction
226
+  (0.0ms) begin transaction
227
+ ------------------------------------
228
+ AuthoritiesTest: test_parse_language
229
+ ------------------------------------
230
+  (0.1ms) rollback transaction
231
+  (0.0ms) begin transaction
232
+ -----------------------------------------
233
+ AuthoritiesTest: test_parse_name_for_role
234
+ -----------------------------------------
235
+  (0.1ms) rollback transaction
236
+  (0.0ms) begin transaction
237
+ --------------------------------
238
+ AuthoritiesTest: test_parse_role
239
+ --------------------------------
240
+  (0.1ms) 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.5
4
+ version: 0.0.6
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-10-20 00:00:00.000000000 Z
11
+ date: 2017-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.4.6
171
+ rubygems_version: 2.5.2
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Methods for enriching and standardizing metadata.