bpl_enrich 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63ca261fe49ac43d3aad9df73b3caa2ce33dce29
4
- data.tar.gz: 70f1ae1ef1a0b9650b75093cff8d3916023cc3cf
3
+ metadata.gz: 51a608b443c4221e52c311ad2b469d1b3d5311cb
4
+ data.tar.gz: 2ee0436cfcb032c3e4baa69762d6b3896b92b52c
5
5
  SHA512:
6
- metadata.gz: 48f5af0440326806c69d638ee8a3cb4b2cb5c28e9b7d4e17128a48b413542a59fb8e063b6d31521089334adb1791b90216e3f10b68b86b176dca0f289b9132ec
7
- data.tar.gz: cedfcdcc85a1bb2d55e7f97117081f45fd5fc77c1b031fe108a4aded7ea258d7e6f35c12e1a0139f4828264369d52bfb1baaa4e0b1933aad71177d18db793aae
6
+ metadata.gz: ff411e63ace8b9b6be84dc7869abaf8e8625aaddb030f4ba353dac177c0cc371a5dc4189e6b6976306d9303094c12ce71f72ad68788bfd6f063c247b7ea834bb
7
+ data.tar.gz: 5143fbb5bb99fc8dfcff2ca5966dc88347660838b20644cfa40585ce5e6c4ae39c679082c4abebf08509070787b9df99c83fc43566f69770c3a2ec39e2ed4c89
@@ -3,8 +3,8 @@ module BplEnrich
3
3
 
4
4
  def self.parse_language(language_value)
5
5
  return_hash = {}
6
- authority_check = Qa::Authorities::Loc.new
7
- authority_result = authority_check.search(URI.escape(language_value), 'iso639-2')
6
+ authority_check = Qa::Authorities::Loc.subauthority_for('iso639-2')
7
+ authority_result = authority_check.search(URI.escape(language_value))
8
8
 
9
9
  if authority_result.present?
10
10
  authority_result = authority_result.select{|hash| hash['label'].downcase == language_value.downcase || hash['id'].split('/').last.downcase == language_value.downcase }
@@ -20,8 +20,8 @@ module BplEnrich
20
20
  #TODO: Research why authority_result = authority_check.search(URI.escape('ctb'), 'relators') doesn't work.
21
21
  def self.parse_role(role_value)
22
22
  return_hash = {}
23
- authority_check = Qa::Authorities::Loc.new
24
- authority_result = authority_check.search(URI.escape(role_value), 'relators')
23
+ authority_check = Qa::Authorities::Loc.subauthority_for('relators')
24
+ authority_result = authority_check.search(URI.escape(role_value))
25
25
  if authority_result.present?
26
26
  authority_result = authority_result.select{|hash| hash['label'].downcase == role_value.downcase }
27
27
  if authority_result.present?
@@ -38,14 +38,14 @@ module BplEnrich
38
38
 
39
39
  #Make sure we have at least three distinct parts of 2-letter+ words. Avoid something like: Steven C. Painter or Painter, Steven C.
40
40
  #Possible Issue: Full name of Steven Carlos Painter ?
41
- potential_role_check = name.to_ascii.match(/[\(\"\',]*\w\w+[\),\"\']* [\w\.,\d\-\"]*[\w\d][\w\d][\w\.,\d\-\"]* [\(\"\',]*\w\w+[\),\"\']*$/) || name.split(/[ ]+/).length >= 4
41
+ potential_role_check = name.to_ascii.match(/[\(\"\',]*\w\w+[\),\"\'\:]* [\w\.,\d\-\"]*[\w\d][\w\d][\w\.,\d\-\"]* [\(\"\',]*\w\w+[\),\"\']*$/) || name.split(/[ ]+/).length >= 4
42
42
 
43
43
  if potential_role_check.present?
44
- authority_check = Qa::Authorities::Loc.new
44
+ authority_check = Qa::Authorities::Loc.subauthority_for('relators')
45
45
 
46
46
  #Check the last value of the name string...
47
47
  role_value = name.to_ascii.match(/(?<=[\(\"\', ])\w+(?=[\),\"\']*$)/).to_s
48
- authority_result = authority_check.search(URI.escape(role_value), 'relators')
48
+ authority_result = authority_check.search(URI.escape(role_value))
49
49
  if authority_result.present?
50
50
 
51
51
  authority_result = authority_result.select{|hash| hash['label'].downcase == role_value.downcase}
@@ -60,13 +60,13 @@ module BplEnrich
60
60
 
61
61
  #Check the last value of the name string...
62
62
  role_value = name.to_ascii.match(/\w+(?=[\),\"\']*)/).to_s
63
- authority_result = authority_check.search(URI.escape(role_value), 'relators')
64
- if authority_result.present? && return_hash.blank?
63
+ authority_result = authority_check.search(URI.escape(role_value))
64
+ if authority_result.present? && return_hash[:uri].blank?
65
65
 
66
66
  authority_result = authority_result.select{|hash| hash['label'].downcase == role_value.downcase}
67
67
  if authority_result.present?
68
68
  #Remove the word and any other characters around it. $ means the end of the line.
69
- return_hash[:name] = name.sub(/[\(\"\', ]*\w+[ \),\"\']*/, '').gsub(/^[ ]*:/, '').strip
69
+ return_hash[:name] = name.sub(/[\(\"\', ]*\w+[ \),\"\']*/, '').gsub(/^[ ]*\:/, '').strip
70
70
  return_hash[:uri] = authority_result.first["id"].gsub('info:lc', 'http://id.loc.gov')
71
71
  return_hash[:label] = authority_result.first["label"]
72
72
  end
@@ -8,7 +8,7 @@ module BplEnrich
8
8
  def self.convert_month_words(date_string)
9
9
  return_date_string = date_string.clone
10
10
 
11
- date_string = date_string.gsub(/[,\/\.]/, ' ').squeeze #switch periods, slashes, and commas that can seperate dates with spaces
11
+ date_string = date_string.gsub(/[,\/\.]/, ' ').squeeze(' ') #switch periods, slashes, and commas that can seperate dates with spaces
12
12
  if date_string.split(' ').any? { |word| Date::MONTHNAMES.include?(word.humanize) || Date::ABBR_MONTHNAMES.include?(word.gsub('.', '').humanize) }
13
13
  return_date_string = ''
14
14
  was_numeric = false
@@ -46,6 +46,7 @@ module BplEnrich
46
46
  date_data = {} # create the hash to hold all the data
47
47
  source_date_string = value.strip # variable to hold original value
48
48
 
49
+ original_value = value
49
50
  value = convert_month_words(value) #Stuff like April 7, 1983
50
51
 
51
52
  # weed out obvious bad dates before processing
@@ -101,13 +102,26 @@ module BplEnrich
101
102
  # format the data properly
102
103
  if range_date.include? '/' # 11/05/1965
103
104
  range_date_pieces = range_date.split('/')
104
- range_date_piece_year = range_date_pieces.last
105
- range_date_piece_month = range_date_pieces.first.length == 2 ? range_date_pieces.first : '0' + range_date_pieces.first
106
- if range_date_pieces.length == 3
107
- range_date_piece_day = range_date_pieces[1].length == 2 ? range_date_pieces[1] : '0' + range_date_pieces[1]
105
+ # 11/05/1965 case
106
+ if range_date_pieces.last.length == 4
107
+ range_date_piece_year = range_date_pieces.last
108
+ range_date_piece_month = range_date_pieces.first.length == 2 ? range_date_pieces.first : '0' + range_date_pieces.first
109
+ if range_date_pieces.length == 3
110
+ range_date_piece_day = range_date_pieces[1].length == 2 ? range_date_pieces[1] : '0' + range_date_pieces[1]
111
+ end
112
+ value_to_insert = range_date_piece_year + '-' + range_date_piece_month
113
+ value_to_insert << '-' + range_date_piece_day if range_date_piece_day
114
+ #1860/10 case
115
+ elsif range_date_pieces.first.length == 4
116
+ range_date_piece_year = range_date_pieces.first
117
+ range_date_piece_month = range_date_pieces[1].length == 2 ? range_date_pieces[1] : '0' + range_date_pieces[1]
118
+ if range_date_pieces.length == 3
119
+ range_date_piece_day = range_date_pieces[2].length == 2 ? range_date_pieces[2] : '0' + range_date_pieces[2]
120
+ end
121
+ value_to_insert = range_date_piece_year + '-' + range_date_piece_month
122
+ value_to_insert << '-' + range_date_piece_day if range_date_piece_day
108
123
  end
109
- value_to_insert = range_date_piece_year + '-' + range_date_piece_month
110
- value_to_insert << '-' + range_date_piece_day if range_date_piece_day
124
+
111
125
  elsif range_date.match(/\A[12][\d]{3}\z/)
112
126
  value_to_insert = range_date
113
127
  end
@@ -231,14 +245,14 @@ module BplEnrich
231
245
  value = value.insert(-5, ' ') if value.match(/[A-Za-z]* \d{6}/) || value.match(/[A-Za-z]* \d{5}/)
232
246
 
233
247
  # try to automatically parse single dates with YYYY && MM && DD values
234
- if Timeliness.parse(value).nil?
248
+ if Timeliness.parse(original_value).nil?
235
249
  # start further processing
236
250
  value.split(' ').each do |split_value|
237
251
  if split_value.match(/\A[12]\d\d\d[-\/\.][01][0-9]\z/) # yyyy-mm || yyyy/mm || yyyy.mm
238
- split_value = split_value.gsub(/[,\/\.]/, '-').squeeze
252
+ split_value = split_value.gsub(/[,\/\.]/, '-').squeeze('-')
239
253
  date_data[:single_date] = split_value
240
254
  elsif split_value.match(/\A[12]\d\d\d[-\/\.][01][0-9][-\/\.][01][0-9]\z/) # yyyy-mm-dd || yyyy/mm/dd || yyyy.mm.dd
241
- split_value = split_value.gsub(/[,\/\.]/, '-').squeeze
255
+ split_value = split_value.gsub(/[,\/\.]/, '-').squeeze('-')
242
256
  date_data[:single_date] = split_value
243
257
  elsif split_value.match(/\A[01]?[1-9][-\/][12]\d\d\d\z/) # mm-yyyy || m-yyyy || mm/yyyy
244
258
  split_value = '0' + split_value if split_value.match(/\A[1-9][-\/\.][12]\d\d\d\z/) # m-yyyy || m/yyyy
@@ -246,7 +260,7 @@ module BplEnrich
246
260
  elsif split_value.match(/\A[12]\d\d\d\z/) # 1999
247
261
  date_data[:single_date] = split_value
248
262
  elsif split_value.match(/\A[01]?[1-9][-\/\.][01]?[1-9][-\/\.][12]\d\d\d\z/) # mm-dd-yyyy || m-dd-yyyy || mm/dd/yyyy
249
- split_value = split_value.gsub(/[,\/\.]/, '/').squeeze
263
+ split_value = split_value.gsub(/[,\/\.]/, '/').squeeze('-')
250
264
  date_data[:single_date] = "#{split_value.split('/')[2]}-#{split_value.split('/')[0]}-#{split_value.split('/')[1]}"
251
265
  end
252
266
 
@@ -256,7 +270,7 @@ module BplEnrich
256
270
  date_data[:date_note] = source_date_string
257
271
  end
258
272
  else
259
- date_data[:single_date] = Timeliness.parse(value).strftime("%Y-%m-%d")
273
+ date_data[:single_date] = Timeliness.parse(original_value).strftime("%Y-%m-%d")
260
274
  end
261
275
 
262
276
  end
@@ -273,7 +287,7 @@ module BplEnrich
273
287
  bad_date = true unless date_to_val[-2..-1].to_i.between?(1,12) && !date_to_val.nil?
274
288
  elsif
275
289
  date_to_val.length == '10'
276
- bad_date = true unless Timeliness.parse(value) && !date_to_val.nil?
290
+ bad_date = true unless Timeliness.parse(original_value) && !date_to_val.nil?
277
291
  end
278
292
  if bad_date
279
293
  date_data[:date_note] ||= source_date_string
@@ -32,6 +32,9 @@ module BplEnrich
32
32
  value = value.gsub(/\s+--/,'--')
33
33
  value = value.gsub(/--\s+/,'--')
34
34
 
35
+ #Ensure a value still exists after all the replacements
36
+ return '' if value.blank?
37
+
35
38
  #Ensure first work is capitalized
36
39
  value[0] = value.first.capitalize[0]
37
40
 
@@ -43,4 +46,4 @@ module BplEnrich
43
46
 
44
47
 
45
48
  end
46
- end
49
+ end
@@ -1,3 +1,3 @@
1
1
  module BplEnrich
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -41,6 +41,16 @@ class AuthoritiesTest < ActiveSupport::TestCase
41
41
  assert_equal 'Photographer', result[:label]
42
42
  assert_equal 'http://id.loc.gov/vocabulary/relators/pht', result[:uri]
43
43
 
44
+ result = BplEnrich::Authorities.parse_name_for_role('Narrator: Gina Snyder')
45
+ assert_equal 'Gina Snyder', result[:name]
46
+ assert_equal 'Narrator', result[:label]
47
+ assert_equal 'http://id.loc.gov/vocabulary/relators/nrt', result[:uri]
48
+
49
+ result = BplEnrich::Authorities.parse_name_for_role('Producer: Reading Public Library')
50
+ assert_equal 'Reading Public Library', result[:name]
51
+ assert_equal 'Producer', result[:label]
52
+ assert_equal 'http://id.loc.gov/vocabulary/relators/pro', result[:uri]
53
+
44
54
 
45
55
  end
46
56
 
data/test/dates_test.rb CHANGED
@@ -29,6 +29,22 @@ class DatesTest < ActiveSupport::TestCase
29
29
  assert_equal '2014-04', result[:date_range][:start]
30
30
  assert_equal '2014-05', result[:date_range][:end]
31
31
  assert_equal nil, result[:date_note]
32
+
33
+ result = BplEnrich::Dates.standardize('2000-06')
34
+ assert_equal '2000-06', result[:single_date]
35
+ assert_equal nil, result[:date_range]
36
+ assert_equal nil, result[:date_note]
37
+
38
+ result = BplEnrich::Dates.standardize('17 June 1962')
39
+ assert_equal '1962-06-17', result[:single_date]
40
+ assert_equal nil, result[:date_range]
41
+ assert_equal nil, result[:date_note]
42
+
43
+ result = BplEnrich::Dates.standardize('1860/10-1862/04')
44
+ assert_equal nil, result[:single_date]
45
+ assert_equal '1860-10', result[:date_range][:start]
46
+ assert_equal '1862-04', result[:date_range][:end]
47
+ assert_equal nil, result[:date_note]
32
48
  end
33
49
 
34
50
 
@@ -1,300 +1,90 @@
1
-  (0.4ms) begin transaction
2
- -------------------------------
3
- BplEnrichTest: test_strip_value
4
- -------------------------------
5
-  (0.1ms) rollback transaction
6
-  (0.1ms) begin transaction
7
- -------------------------------
8
- DatesTest: test_date_conversion
9
- -------------------------------
10
-  (0.3ms) rollback transaction
11
-  (0.2ms) begin transaction
1
+  (0.0ms) begin transaction
12
2
  --------------------------------
13
3
  LCSHTest: test_lcsh_standardizer
14
4
  --------------------------------
15
-  (0.2ms) rollback transaction
16
-  (0.5ms) begin transaction
17
- -------------------------------
18
- BplEnrichTest: test_strip_value
19
- -------------------------------
20
-  (0.1ms) rollback transaction
21
-  (0.1ms) begin transaction
22
- -------------------------------
23
- DatesTest: test_date_conversion
24
- -------------------------------
25
-  (0.4ms) rollback transaction
26
-  (0.2ms) begin transaction
27
- --------------------------------
28
- LCSHTest: test_lcsh_standardizer
29
- --------------------------------
30
-  (0.1ms) rollback transaction
31
-  (1.0ms) begin transaction
32
- ------------------------------------
33
- AuthoritiesTest: test_parse_language
34
- ------------------------------------
35
-  (0.3ms) rollback transaction
36
-  (0.2ms) begin transaction
37
- -----------------------------------------
38
- AuthoritiesTest: test_parse_name_for_role
39
- -----------------------------------------
40
-  (0.2ms) rollback transaction
41
-  (0.2ms) begin transaction
42
- --------------------------------
43
- AuthoritiesTest: test_parse_role
44
- --------------------------------
45
-  (0.2ms) rollback transaction
46
-  (0.1ms) begin transaction
47
- -------------------------------
48
- BplEnrichTest: test_strip_value
49
- -------------------------------
50
-  (0.1ms) rollback transaction
51
-  (0.1ms) begin transaction
52
- ---------------------------------
53
- DatesTest: test_date_standardizer
54
- ---------------------------------
55
-  (0.1ms) rollback transaction
56
-  (0.1ms) begin transaction
57
- --------------------------------
58
- LCSHTest: test_lcsh_standardizer
59
- --------------------------------
60
-  (0.1ms) rollback transaction
61
-  (0.3ms) begin transaction
62
- ------------------------------------
63
- AuthoritiesTest: test_parse_language
64
- ------------------------------------
65
-  (0.3ms) rollback transaction
66
-  (0.2ms) begin transaction
67
- -----------------------------------------
68
- AuthoritiesTest: test_parse_name_for_role
69
- -----------------------------------------
70
-  (0.2ms) rollback transaction
71
-  (0.1ms) begin transaction
72
- --------------------------------
73
- AuthoritiesTest: test_parse_role
74
- --------------------------------
75
-  (0.2ms) rollback transaction
76
-  (0.1ms) begin transaction
77
- -------------------------------
78
- BplEnrichTest: test_strip_value
79
- -------------------------------
80
-  (0.1ms) rollback transaction
81
-  (0.2ms) begin transaction
5
+  (0.0ms) rollback transaction
6
+  (0.0ms) begin transaction
82
7
  ---------------------------------
83
8
  DatesTest: test_date_standardizer
84
9
  ---------------------------------
85
-  (0.3ms) rollback transaction
86
-  (0.2ms) begin transaction
87
- --------------------------------
88
- LCSHTest: test_lcsh_standardizer
89
- --------------------------------
90
-  (0.1ms) rollback transaction
91
-  (0.4ms) begin transaction
10
+  (0.0ms) rollback transaction
11
+  (0.0ms) begin transaction
92
12
  ------------------------------------
93
13
  AuthoritiesTest: test_parse_language
94
14
  ------------------------------------
95
15
   (0.1ms) rollback transaction
96
-  (0.1ms) begin transaction
16
+  (0.0ms) begin transaction
97
17
  -----------------------------------------
98
18
  AuthoritiesTest: test_parse_name_for_role
99
19
  -----------------------------------------
100
20
   (0.1ms) rollback transaction
101
-  (0.1ms) begin transaction
21
+  (0.0ms) begin transaction
102
22
  --------------------------------
103
23
  AuthoritiesTest: test_parse_role
104
24
  --------------------------------
105
-  (0.3ms) rollback transaction
106
-  (0.1ms) begin transaction
107
- -------------------------------
108
- BplEnrichTest: test_strip_value
109
- -------------------------------
110
-  (0.2ms) rollback transaction
111
-  (0.1ms) begin transaction
112
- ---------------------------------
113
- DatesTest: test_date_standardizer
114
- ---------------------------------
115
25
   (0.1ms) rollback transaction
116
-  (0.1ms) begin transaction
117
- --------------------------------
118
- LCSHTest: test_lcsh_standardizer
119
- --------------------------------
120
-  (0.1ms) rollback transaction
121
-  (0.4ms) begin transaction
122
- ------------------------------------
123
- AuthoritiesTest: test_parse_language
124
- ------------------------------------
125
-  (0.3ms) rollback transaction
126
-  (0.2ms) begin transaction
127
- -----------------------------------------
128
- AuthoritiesTest: test_parse_name_for_role
129
- -----------------------------------------
130
-  (0.2ms) rollback transaction
131
-  (0.2ms) begin transaction
132
- --------------------------------
133
- AuthoritiesTest: test_parse_role
134
- --------------------------------
135
-  (0.3ms) rollback transaction
136
-  (0.2ms) begin transaction
26
+  (0.0ms) begin transaction
137
27
  -------------------------------
138
28
  BplEnrichTest: test_strip_value
139
29
  -------------------------------
140
-  (0.2ms) rollback transaction
141
-  (0.2ms) begin transaction
30
+  (0.0ms) rollback transaction
31
+  (0.0ms) begin transaction
142
32
  ---------------------------------
143
33
  DatesTest: test_date_standardizer
144
34
  ---------------------------------
145
-  (0.1ms) rollback transaction
146
-  (0.1ms) begin transaction
35
+  (0.0ms) rollback transaction
36
+  (0.0ms) begin transaction
147
37
  --------------------------------
148
38
  LCSHTest: test_lcsh_standardizer
149
39
  --------------------------------
150
-  (0.1ms) rollback transaction
151
-  (0.6ms) begin transaction
152
- ------------------------------------
153
- AuthoritiesTest: test_parse_language
154
- ------------------------------------
155
-  (0.3ms) rollback transaction
156
-  (0.2ms) begin transaction
157
- -----------------------------------------
158
- AuthoritiesTest: test_parse_name_for_role
159
- -----------------------------------------
160
-  (0.3ms) rollback transaction
161
-  (0.2ms) begin transaction
162
- --------------------------------
163
- AuthoritiesTest: test_parse_role
164
- --------------------------------
165
-  (0.3ms) rollback transaction
166
-  (0.2ms) begin transaction
40
+  (0.0ms) rollback transaction
41
+  (0.0ms) begin transaction
167
42
  -------------------------------
168
43
  BplEnrichTest: test_strip_value
169
44
  -------------------------------
170
-  (0.2ms) rollback transaction
171
-  (0.1ms) begin transaction
172
- ---------------------------------
173
- DatesTest: test_date_standardizer
174
- ---------------------------------
175
-  (0.1ms) rollback transaction
176
-  (0.1ms) begin transaction
177
- --------------------------------
178
- LCSHTest: test_lcsh_standardizer
179
- --------------------------------
180
-  (0.1ms) rollback transaction
181
-  (0.7ms) begin transaction
45
+  (0.0ms) rollback transaction
46
+  (0.0ms) begin transaction
182
47
  ------------------------------------
183
48
  AuthoritiesTest: test_parse_language
184
49
  ------------------------------------
185
-  (0.3ms) rollback transaction
186
-  (0.2ms) begin transaction
187
- -----------------------------------------
188
- AuthoritiesTest: test_parse_name_for_role
189
- -----------------------------------------
190
-  (0.3ms) rollback transaction
191
-  (0.2ms) begin transaction
192
- --------------------------------
193
- AuthoritiesTest: test_parse_role
194
- --------------------------------
195
-  (0.3ms) rollback transaction
196
-  (0.2ms) begin transaction
197
- -------------------------------
198
- BplEnrichTest: test_strip_value
199
- -------------------------------
200
-  (0.1ms) rollback transaction
201
-  (0.2ms) begin transaction
202
- ---------------------------------
203
- DatesTest: test_date_standardizer
204
- ---------------------------------
205
-  (0.2ms) rollback transaction
206
-  (0.1ms) begin transaction
207
- --------------------------------
208
- LCSHTest: test_lcsh_standardizer
209
- --------------------------------
210
50
   (0.1ms) rollback transaction
211
-  (0.5ms) begin transaction
212
- ------------------------------------
213
- AuthoritiesTest: test_parse_language
214
- ------------------------------------
215
-  (0.3ms) rollback transaction
216
-  (0.2ms) begin transaction
51
+  (0.0ms) begin transaction
217
52
  -----------------------------------------
218
53
  AuthoritiesTest: test_parse_name_for_role
219
54
  -----------------------------------------
220
-  (0.3ms) rollback transaction
221
-  (0.2ms) begin transaction
55
+  (0.1ms) rollback transaction
56
+  (0.0ms) begin transaction
222
57
  --------------------------------
223
58
  AuthoritiesTest: test_parse_role
224
59
  --------------------------------
225
-  (0.3ms) rollback transaction
226
-  (0.2ms) begin transaction
60
+  (0.1ms) rollback transaction
61
+  (0.0ms) begin transaction
227
62
  -------------------------------
228
63
  BplEnrichTest: test_strip_value
229
64
  -------------------------------
230
-  (0.2ms) rollback transaction
231
-  (0.1ms) begin transaction
232
- ---------------------------------
233
- DatesTest: test_date_standardizer
234
- ---------------------------------
235
-  (0.2ms) rollback transaction
236
-  (0.1ms) begin transaction
237
- --------------------------------
238
- LCSHTest: test_lcsh_standardizer
239
- --------------------------------
240
-  (0.1ms) rollback transaction
241
-  (0.4ms) begin transaction
65
+  (0.0ms) rollback transaction
66
+  (0.0ms) begin transaction
242
67
  ------------------------------------
243
68
  AuthoritiesTest: test_parse_language
244
69
  ------------------------------------
245
-  (0.3ms) rollback transaction
246
-  (0.2ms) begin transaction
70
+  (0.1ms) rollback transaction
71
+  (0.0ms) begin transaction
247
72
  -----------------------------------------
248
73
  AuthoritiesTest: test_parse_name_for_role
249
74
  -----------------------------------------
250
-  (0.3ms) rollback transaction
251
-  (0.2ms) begin transaction
75
+  (0.1ms) rollback transaction
76
+  (0.0ms) begin transaction
252
77
  --------------------------------
253
78
  AuthoritiesTest: test_parse_role
254
79
  --------------------------------
255
-  (0.3ms) rollback transaction
256
-  (0.2ms) begin transaction
257
- -------------------------------
258
- BplEnrichTest: test_strip_value
259
- -------------------------------
260
-  (0.2ms) rollback transaction
261
-  (0.5ms) begin transaction
262
- ---------------------------------
263
- DatesTest: test_date_standardizer
264
- ---------------------------------
265
80
   (0.1ms) rollback transaction
266
-  (0.1ms) begin transaction
81
+  (0.0ms) begin transaction
267
82
  --------------------------------
268
83
  LCSHTest: test_lcsh_standardizer
269
84
  --------------------------------
270
-  (0.1ms) rollback transaction
271
-  (0.8ms) begin transaction
272
- ------------------------------------
273
- AuthoritiesTest: test_parse_language
274
- ------------------------------------
275
-  (0.3ms) rollback transaction
276
-  (0.2ms) begin transaction
277
- -----------------------------------------
278
- AuthoritiesTest: test_parse_name_for_role
279
- -----------------------------------------
280
-  (0.3ms) rollback transaction
281
-  (0.2ms) begin transaction
282
- --------------------------------
283
- AuthoritiesTest: test_parse_role
284
- --------------------------------
285
-  (0.1ms) rollback transaction
286
-  (0.1ms) begin transaction
287
- -------------------------------
288
- BplEnrichTest: test_strip_value
289
- -------------------------------
290
-  (0.1ms) rollback transaction
291
-  (0.2ms) begin transaction
85
+  (0.0ms) rollback transaction
86
+  (0.0ms) begin transaction
292
87
  ---------------------------------
293
88
  DatesTest: test_date_standardizer
294
89
  ---------------------------------
295
-  (0.3ms) rollback transaction
296
-  (0.1ms) begin transaction
297
- --------------------------------
298
- LCSHTest: test_lcsh_standardizer
299
- --------------------------------
300
-  (0.1ms) rollback transaction
90
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bpl_enrich
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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: 2014-06-15 00:00:00.000000000 Z
11
+ date: 2016-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.1
19
+ version: '4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.1
26
+ version: '4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: timeliness
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: unidecoder
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: htmlentities
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: qa
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 0.5.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 0.5.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: sqlite3
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Methods for enriching and standardizing metadata.
@@ -102,53 +102,53 @@ executables: []
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
+ - Rakefile
105
106
  - lib/bpl_enrich.rb
106
- - lib/tasks/bpl_enrich_tasks.rake
107
- - lib/bpl_enrich/lcsh.rb
108
- - lib/bpl_enrich/constants.rb
109
- - lib/bpl_enrich/version.rb
110
107
  - lib/bpl_enrich/authorities.rb
108
+ - lib/bpl_enrich/constants.rb
111
109
  - lib/bpl_enrich/dates.rb
112
- - Rakefile
110
+ - lib/bpl_enrich/lcsh.rb
111
+ - lib/bpl_enrich/version.rb
112
+ - lib/tasks/bpl_enrich_tasks.rake
113
+ - test/authorities_test.rb
114
+ - test/bpl_enrich_test.rb
113
115
  - test/dates_test.rb
116
+ - test/dummy/README.rdoc
114
117
  - test/dummy/Rakefile
118
+ - test/dummy/app/assets/javascripts/application.js
119
+ - test/dummy/app/assets/stylesheets/application.css
120
+ - test/dummy/app/controllers/application_controller.rb
121
+ - test/dummy/app/helpers/application_helper.rb
122
+ - test/dummy/app/views/layouts/application.html.erb
123
+ - test/dummy/bin/bundle
124
+ - test/dummy/bin/rails
125
+ - test/dummy/bin/rake
115
126
  - test/dummy/config.ru
116
- - test/dummy/public/500.html
117
- - test/dummy/public/404.html
118
- - test/dummy/public/422.html
119
- - test/dummy/public/favicon.ico
127
+ - test/dummy/config/application.rb
128
+ - test/dummy/config/boot.rb
120
129
  - test/dummy/config/database.yml
121
- - test/dummy/config/initializers/secret_token.rb
122
- - test/dummy/config/initializers/filter_parameter_logging.rb
130
+ - test/dummy/config/environment.rb
131
+ - test/dummy/config/environments/development.rb
132
+ - test/dummy/config/environments/production.rb
133
+ - test/dummy/config/environments/test.rb
123
134
  - test/dummy/config/initializers/backtrace_silencers.rb
124
- - test/dummy/config/initializers/wrap_parameters.rb
135
+ - test/dummy/config/initializers/filter_parameter_logging.rb
136
+ - test/dummy/config/initializers/inflections.rb
125
137
  - test/dummy/config/initializers/mime_types.rb
138
+ - test/dummy/config/initializers/secret_token.rb
126
139
  - test/dummy/config/initializers/session_store.rb
127
- - test/dummy/config/initializers/inflections.rb
140
+ - test/dummy/config/initializers/wrap_parameters.rb
128
141
  - test/dummy/config/locales/en.yml
129
142
  - test/dummy/config/routes.rb
130
- - test/dummy/config/boot.rb
131
- - test/dummy/config/environment.rb
132
- - test/dummy/config/environments/development.rb
133
- - test/dummy/config/environments/test.rb
134
- - test/dummy/config/environments/production.rb
135
- - test/dummy/config/application.rb
136
143
  - test/dummy/db/test.sqlite3
137
- - test/dummy/app/views/layouts/application.html.erb
138
- - test/dummy/app/helpers/application_helper.rb
139
- - test/dummy/app/controllers/application_controller.rb
140
- - test/dummy/app/assets/javascripts/application.js
141
- - test/dummy/app/assets/stylesheets/application.css
142
- - test/dummy/bin/rails
143
- - test/dummy/bin/bundle
144
- - test/dummy/bin/rake
145
- - test/dummy/log/test.log
146
144
  - test/dummy/log/development.log
147
- - test/dummy/README.rdoc
148
- - test/test_helper.rb
145
+ - test/dummy/log/test.log
146
+ - test/dummy/public/404.html
147
+ - test/dummy/public/422.html
148
+ - test/dummy/public/500.html
149
+ - test/dummy/public/favicon.ico
149
150
  - test/lcsh_test.rb
150
- - test/bpl_enrich_test.rb
151
- - test/authorities_test.rb
151
+ - test/test_helper.rb
152
152
  homepage: http://www.bpl.org
153
153
  licenses: []
154
154
  metadata: {}
@@ -158,57 +158,57 @@ require_paths:
158
158
  - lib
159
159
  required_ruby_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - '>='
161
+ - - ">="
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - '>='
166
+ - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.0.3
171
+ rubygems_version: 2.4.6
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Methods for enriching and standardizing metadata.
175
175
  test_files:
176
176
  - test/dates_test.rb
177
- - test/dummy/Rakefile
178
177
  - test/dummy/config.ru
179
- - test/dummy/public/500.html
180
- - test/dummy/public/404.html
178
+ - test/dummy/app/helpers/application_helper.rb
179
+ - test/dummy/app/assets/stylesheets/application.css
180
+ - test/dummy/app/assets/javascripts/application.js
181
+ - test/dummy/app/controllers/application_controller.rb
182
+ - test/dummy/app/views/layouts/application.html.erb
183
+ - test/dummy/log/test.log
184
+ - test/dummy/log/development.log
185
+ - test/dummy/bin/rails
186
+ - test/dummy/bin/bundle
187
+ - test/dummy/bin/rake
181
188
  - test/dummy/public/422.html
182
189
  - test/dummy/public/favicon.ico
183
- - test/dummy/config/database.yml
184
- - test/dummy/config/initializers/secret_token.rb
185
- - test/dummy/config/initializers/filter_parameter_logging.rb
186
- - test/dummy/config/initializers/backtrace_silencers.rb
190
+ - test/dummy/public/500.html
191
+ - test/dummy/public/404.html
192
+ - test/dummy/README.rdoc
193
+ - test/dummy/Rakefile
194
+ - test/dummy/db/test.sqlite3
195
+ - test/dummy/config/routes.rb
196
+ - test/dummy/config/application.rb
197
+ - test/dummy/config/environment.rb
187
198
  - test/dummy/config/initializers/wrap_parameters.rb
199
+ - test/dummy/config/initializers/backtrace_silencers.rb
188
200
  - test/dummy/config/initializers/mime_types.rb
201
+ - test/dummy/config/initializers/filter_parameter_logging.rb
189
202
  - test/dummy/config/initializers/session_store.rb
190
203
  - test/dummy/config/initializers/inflections.rb
191
- - test/dummy/config/locales/en.yml
192
- - test/dummy/config/routes.rb
204
+ - test/dummy/config/initializers/secret_token.rb
193
205
  - test/dummy/config/boot.rb
194
- - test/dummy/config/environment.rb
195
- - test/dummy/config/environments/development.rb
206
+ - test/dummy/config/locales/en.yml
196
207
  - test/dummy/config/environments/test.rb
208
+ - test/dummy/config/environments/development.rb
197
209
  - test/dummy/config/environments/production.rb
198
- - test/dummy/config/application.rb
199
- - test/dummy/db/test.sqlite3
200
- - test/dummy/app/views/layouts/application.html.erb
201
- - test/dummy/app/helpers/application_helper.rb
202
- - test/dummy/app/controllers/application_controller.rb
203
- - test/dummy/app/assets/javascripts/application.js
204
- - test/dummy/app/assets/stylesheets/application.css
205
- - test/dummy/bin/rails
206
- - test/dummy/bin/bundle
207
- - test/dummy/bin/rake
208
- - test/dummy/log/test.log
209
- - test/dummy/log/development.log
210
- - test/dummy/README.rdoc
211
- - test/test_helper.rb
210
+ - test/dummy/config/database.yml
212
211
  - test/lcsh_test.rb
213
- - test/bpl_enrich_test.rb
214
212
  - test/authorities_test.rb
213
+ - test/bpl_enrich_test.rb
214
+ - test/test_helper.rb