cul_scv_hydra 0.22.8 → 0.22.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fixtures/spec/CUL_MODS/mods-date-end-with-all-u-characters.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-date-start-with-all-u-characters.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-dates-with-all-u-characters.xml +7 -0
- data/fixtures/spec/CUL_MODS/mods-dates-with-some-u-characters.xml +7 -0
- data/lib/cul_hydra/solrizer/mods_fieldable.rb +28 -15
- data/lib/cul_hydra/version.rb +1 -1
- data/lib/cul_hydra/version.rb~ +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3bfdbde8c8ab4486d3b85fa6db992a5c28f88de
|
4
|
+
data.tar.gz: 7ac54765be9032aa1ee8bf82f026fe609ef90812
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79d947da95140479bae797c5ac45904acb83e8b141798a10116ebb208eb0e079bf13a329d4367926ade338f162de8e1cfc74e7fd47d4a9e3867036d3e08b299d
|
7
|
+
data.tar.gz: 455bcd3ba5a7dd253a6e286ec690c4726cd26eb19b054af8f488629a8552d96b79160531085f48101043f5ad8acd4c53189ce62d182f4b2b525977f48533af19
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
|
3
|
+
<originInfo>
|
4
|
+
<dateOther encoding='w3cdtf' keyDate='yes' point='start'>1870</dateOther>
|
5
|
+
<dateOther encoding='w3cdtf' point='end'>uuuu</dateOther>
|
6
|
+
</originInfo>
|
7
|
+
</mods>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
|
3
|
+
<originInfo>
|
4
|
+
<dateOther encoding='w3cdtf' keyDate='yes' point='start'>uuuu</dateOther>
|
5
|
+
<dateOther encoding='w3cdtf' point='end'>1920</dateOther>
|
6
|
+
</originInfo>
|
7
|
+
</mods>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
|
3
|
+
<originInfo>
|
4
|
+
<dateOther encoding='w3cdtf' keyDate='yes' point='start'>uuuu</dateOther>
|
5
|
+
<dateOther encoding='w3cdtf' point='end'>uuuu</dateOther>
|
6
|
+
</originInfo>
|
7
|
+
</mods>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
|
3
|
+
<originInfo>
|
4
|
+
<dateOther encoding='w3cdtf' keyDate='yes' point='start'>187u</dateOther>
|
5
|
+
<dateOther encoding='w3cdtf' point='end'>19uu</dateOther>
|
6
|
+
</originInfo>
|
7
|
+
</mods>
|
@@ -392,25 +392,38 @@ module Cul::Hydra::Solrizer
|
|
392
392
|
|
393
393
|
if start_date.present?
|
394
394
|
|
395
|
-
|
395
|
+
start_year = nil
|
396
|
+
end_year = nil
|
396
397
|
|
397
|
-
|
398
|
+
start_date = nil if start_date == 'uuuu'
|
399
|
+
end_date = nil if end_date == 'uuuu'
|
400
|
+
start_date = start_date.gsub('u', '0') unless start_date.nil?
|
401
|
+
end_date = end_date.gsub('u', '0') unless end_date.nil?
|
398
402
|
|
399
|
-
|
400
|
-
|
401
|
-
start_year = start_year_match.captures[0]
|
402
|
-
start_year = zero_pad_year(start_year)
|
403
|
-
solr_doc["lib_start_date_year_itsi"] = start_year.to_i # TrieInt version for searches
|
404
|
-
end
|
403
|
+
end_date = start_date if end_date.blank?
|
404
|
+
start_date = end_date if start_date.blank?
|
405
405
|
|
406
|
-
|
407
|
-
if end_year_match && end_year_match.captures.length > 0
|
408
|
-
end_year = end_year_match.captures[0]
|
409
|
-
end_year = zero_pad_year(end_year)
|
410
|
-
solr_doc["lib_end_date_year_itsi"] = end_year.to_i # TrieInt version for searches
|
411
|
-
end
|
406
|
+
year_regex = /^(-?\d{1,4}).*/
|
412
407
|
|
413
|
-
|
408
|
+
unless start_date.blank?
|
409
|
+
start_year_match = start_date.match(year_regex)
|
410
|
+
if start_year_match && start_year_match.captures.length > 0
|
411
|
+
start_year = start_year_match.captures[0]
|
412
|
+
start_year = zero_pad_year(start_year)
|
413
|
+
solr_doc["lib_start_date_year_itsi"] = start_year.to_i # TrieInt version for searches
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
417
|
+
unless end_date.blank?
|
418
|
+
end_year_match = end_date.match(year_regex)
|
419
|
+
if end_year_match && end_year_match.captures.length > 0
|
420
|
+
end_year = end_year_match.captures[0]
|
421
|
+
end_year = zero_pad_year(end_year)
|
422
|
+
solr_doc["lib_end_date_year_itsi"] = end_year.to_i # TrieInt version for searches
|
423
|
+
end
|
424
|
+
end
|
425
|
+
|
426
|
+
solr_doc["lib_date_year_range_si"] = start_year + '-' + end_year if start_year && end_year
|
414
427
|
|
415
428
|
# When no textual date is available, fall back to other date data (if available)
|
416
429
|
if solr_doc["lib_date_textual_ssm"].blank?
|
data/lib/cul_hydra/version.rb
CHANGED
data/lib/cul_hydra/version.rb~
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cul_scv_hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.22.
|
4
|
+
version: 0.22.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-03-
|
12
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|
@@ -393,11 +393,15 @@ files:
|
|
393
393
|
- fixtures/spec/CUL_MODS/mods-bad-repo.xml
|
394
394
|
- fixtures/spec/CUL_MODS/mods-date-created-range.xml
|
395
395
|
- fixtures/spec/CUL_MODS/mods-date-created-single.xml
|
396
|
+
- fixtures/spec/CUL_MODS/mods-date-end-with-all-u-characters.xml
|
396
397
|
- fixtures/spec/CUL_MODS/mods-date-issued-range.xml
|
397
398
|
- fixtures/spec/CUL_MODS/mods-date-issued-single.xml
|
398
399
|
- fixtures/spec/CUL_MODS/mods-date-other-range.xml
|
399
400
|
- fixtures/spec/CUL_MODS/mods-date-other-single.xml
|
400
401
|
- fixtures/spec/CUL_MODS/mods-date-range-short-years.xml
|
402
|
+
- fixtures/spec/CUL_MODS/mods-date-start-with-all-u-characters.xml
|
403
|
+
- fixtures/spec/CUL_MODS/mods-dates-with-all-u-characters.xml
|
404
|
+
- fixtures/spec/CUL_MODS/mods-dates-with-some-u-characters.xml
|
401
405
|
- fixtures/spec/CUL_MODS/mods-item.xml
|
402
406
|
- fixtures/spec/CUL_MODS/mods-names.xml
|
403
407
|
- fixtures/spec/CUL_MODS/mods-notes.xml
|