bpl_enrich 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bpl_enrich/dates.rb +1 -1
- data/lib/bpl_enrich/version.rb +1 -1
- data/test/dates_test.rb +7 -0
- data/test/dummy/log/test.log +30 -0
- 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: 95cfb975117e1f8ee56d5a6ee1f29fe1f4f8e287
|
4
|
+
data.tar.gz: 61b8b2b2d49513198c468067064483f866802af1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfb47e5ad134b9a5e39560ab506ca8951d23cc4fbf60134f5d6e98f237ffba18e5b905a8a17fb6e37c940cd1e813489ec7128068c9680fd37d4cc9bd717568b5
|
7
|
+
data.tar.gz: 3efa54d7b3c4cff78cefbc395e03628433b9aeef66d5b6476ea5cd5d4ed2da69f5f72f51077d0cafbed47027346f29511fb5f49214fab75f14ab5923fc7e59ca
|
data/lib/bpl_enrich/dates.rb
CHANGED
@@ -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|\
|
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) ||
|
data/lib/bpl_enrich/version.rb
CHANGED
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
|
|
data/test/dummy/log/test.log
CHANGED
@@ -176,5 +176,35 @@ BplEnrichTest: test_strip_value
|
|
176
176
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
177
177
|
---------------------------------
|
178
178
|
DatesTest: test_date_standardizer
|
179
|
+
---------------------------------
|
180
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
181
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
182
|
+
--------------------------------
|
183
|
+
LCSHTest: test_lcsh_standardizer
|
184
|
+
--------------------------------
|
185
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
186
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
187
|
+
------------------------------------
|
188
|
+
AuthoritiesTest: test_parse_language
|
189
|
+
------------------------------------
|
190
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
191
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
192
|
+
-----------------------------------------
|
193
|
+
AuthoritiesTest: test_parse_name_for_role
|
194
|
+
-----------------------------------------
|
195
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
196
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
197
|
+
--------------------------------
|
198
|
+
AuthoritiesTest: test_parse_role
|
199
|
+
--------------------------------
|
200
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
201
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
202
|
+
-------------------------------
|
203
|
+
BplEnrichTest: test_strip_value
|
204
|
+
-------------------------------
|
205
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
206
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
207
|
+
---------------------------------
|
208
|
+
DatesTest: test_date_standardizer
|
179
209
|
---------------------------------
|
180
210
|
[1m[35m (0.0ms)[0m 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
|
+
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-
|
11
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|