mabmapper 1.0.0.pre16 → 1.0.0.pre17

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: c386816c140e51c20adc3f14f7a9e3366f5c0fe8
4
- data.tar.gz: 1712293a68164eea826a58fe020ffb717d130411
3
+ metadata.gz: bdf536c639f0b58298541ad181bcb6ad6f7e9bc6
4
+ data.tar.gz: 02a320e1e8ca2257e7f4e5005fbcb5ce28dd92b2
5
5
  SHA512:
6
- metadata.gz: c8fbde45856cb171d4a762f477a019ae6a1958e7061ed0511f47ab08d977679d13d599f8166f049bdf2e53f51f13ac1bc02e69d0de32e84babab971429a317be
7
- data.tar.gz: 761f5ed07daec64d18e6d53aac08f6b886026600cdca9762569b42933288d25d43f0fcbf03bb9bccbbcee509e521fcd0c2f2768e798be0b8f4f4fe8358be0102
6
+ metadata.gz: 747f856758c92148928e6f8542bfef524e625c43fb6a44a63010ac9a9bde14bcc32474d4deb380d825c2b4264bda59afbaf464f3959794e677f2ac9f74e814e5
7
+ data.tar.gz: e0383128c2a680ae2729a43fa91de61b91800f0a3e13ce47e79899d0441f9e5471dd257a71b73b7612649c8507809de8e989983b552ecbe808a8e878c86c680c
@@ -163,11 +163,11 @@ module Mabmapper
163
163
  end
164
164
 
165
165
  field :short_title_display do
166
- f089_1 = doc.field('089', ind2: '1').subfield('a').get.value # Bandangabe in Vorlageform
166
+ f089_1 = doc.field('089', ind2: '1').subfield('a').get.value # Bandangabe in Vorlageform
167
167
  f310_1 = doc.field('310', ind1: ['-', 'a'], ind2: '1').subfield('a').get.value # Hauptsachtitel in Ansetzungsform
168
168
  f331_1 = doc.field('331', ind2: '1').subfield('a').get.value # Hauptsachtitel in Vorlageform oder Mischform
169
169
  f331_2 = doc.field('331', ind2: '2').subfield('a').get.value #
170
- f334_1 = doc.field('334', ind1: '-', ind2: '1').get.value # Allgemeine Materialbenennung
170
+ f334_1 = doc.field('334', ind1: '-', ind2: '1').get.value # Allgemeine Materialbenennung
171
171
  f335_1 = doc.field('335', ind2: '1').subfield('a').get.value # Zusätze zum Hauptsachtitel
172
172
 
173
173
  short_title = if f310_1
@@ -847,6 +847,32 @@ module Mabmapper
847
847
  count.rjust(15, '0') if count.present?
848
848
  end
849
849
 
850
+ field :volume_count_sort2 do
851
+ possible_values = []
852
+ possible_values << doc.field('090', ind2: '1').subfield('a').get.value
853
+ (451..491).step(10) { |f| possible_values << doc.field("#{f+5}", ind2: '1').subfield('a').get.value }
854
+ count = possible_values.map(&:presence).compact.uniq.first
855
+
856
+ if count.present?
857
+ # extract the count groups
858
+ count_groups = count.split(',')
859
+ # make sure we have always 4 groups
860
+ count_groups = Array.new(4) { |i| count_groups[i] }
861
+ # make sure every group is a string
862
+ count_groups.map!{ |g| g.to_s }
863
+ # clean things up a bit
864
+ count_groups.map!{ |g| g.gsub(/\[|\]/, '').strip }
865
+ # fill up each group to 6 characters
866
+ count_groups.map!{ |g| g.rjust(6, '0') }
867
+ # make sure each group is really 6 characters.
868
+ count_groups.map!{ |g| g[0..5] }
869
+ # finally join
870
+ count_groups.join
871
+ else
872
+ nil
873
+ end
874
+ end
875
+
850
876
  #
851
877
  # Notation
852
878
  #
@@ -1222,10 +1248,10 @@ module Mabmapper
1222
1248
  person_contributor_display: ref(:person_contributor_display),
1223
1249
  person_creator_display: ref(:person_creator_display),
1224
1250
  redactional_remark: ref(:redactional_remark)
1225
-
1251
+
1226
1252
  }
1227
1253
  .inject({}) { |hash, (key, value)| hash[key] = value if value.present?; hash }
1228
-
1254
+
1229
1255
  additional_data.to_json if additional_data.present?
1230
1256
  end
1231
1257
 
@@ -1,3 +1,3 @@
1
1
  module Mabmapper
2
- VERSION = "1.0.0.pre16"
2
+ VERSION = "1.0.0.pre17"
3
3
  end
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
3
+ <ListRecords>
4
+ <record>
5
+ <header>
6
+ <identifier>aleph-publish:001015068</identifier>
7
+ </header>
8
+ <metadata>
9
+ <record xmlns="http://www.ddb.de/professionell/mabxml/mabxml-1.xsd">
10
+ <datafield tag="090" ind1="-" ind2="1">
11
+ <subfield code="a">[19]99,35,b</subfield>
12
+ </datafield>
13
+ </record>
14
+ </metadata>
15
+ </record>
16
+ </ListRecords>
17
+ </OAI-PMH>
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
3
+ <ListRecords>
4
+ <record>
5
+ <header>
6
+ <identifier>aleph-publish:001015068</identifier>
7
+ </header>
8
+ <metadata>
9
+ <record xmlns="http://www.ddb.de/professionell/mabxml/mabxml-1.xsd">
10
+ <datafield tag="089" ind1="-" ind2="1">
11
+ <subfield code="a">Bd. 2, Teilbd. 1, Von der Frühen Neuzeit bis zum Ersten Weltkrieg</subfield>
12
+ <subfield code="a">[Schülerbd.]</subfield>
13
+ </datafield>
14
+ <datafield tag="090" ind1="-" ind2="1">
15
+ <subfield code="a">2,x,1,schuel</subfield>
16
+ </datafield>
17
+ </record>
18
+ </metadata>
19
+ </record>
20
+ </ListRecords>
21
+ </OAI-PMH>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
3
+ <ListRecords>
4
+ <record>
5
+ <header>
6
+ <identifier>aleph-publish:001499879</identifier>
7
+ </header>
8
+ <metadata>
9
+ <record xmlns="http://www.ddb.de/professionell/mabxml/mabxml-1.xsd">
10
+ <datafield tag="089" ind1="-" ind2="1">
11
+ <subfield code="a">1</subfield>
12
+ </datafield>
13
+ <datafield tag="090" ind1="-" ind2="1">
14
+ <subfield code="a">1</subfield>
15
+ </datafield>
16
+ </record>
17
+ </metadata>
18
+ </record>
19
+ </ListRecords>
20
+ </OAI-PMH>
@@ -0,0 +1,6 @@
1
+ # coding: utf-8
2
+ module TestVolumeCountSort2
3
+ define_field_test 'test1', volume_count_sort2: '00199900003500000b000000'
4
+ define_field_test 'test2', volume_count_sort2: '00000200000x000001schuel'
5
+ define_field_test 'test3', volume_count_sort2: '000001000000000000000000'
6
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mabmapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre16
4
+ version: 1.0.0.pre17
5
5
  platform: ruby
6
6
  authors:
7
7
  - René Sprotte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-23 00:00:00.000000000 Z
11
+ date: 2014-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -380,6 +380,9 @@ files:
380
380
  - test/mab_files/test_title_sort/PAD01.000992332.PRIMO.xml
381
381
  - test/mab_files/test_volume_count_sort/PAD01.001015068.PRIMO.xml
382
382
  - test/mab_files/test_volume_count_sort/PAD01.001499879.PRIMO.xml
383
+ - test/mab_files/test_volume_count_sort2/test1.xml
384
+ - test/mab_files/test_volume_count_sort2/test2.xml
385
+ - test/mab_files/test_volume_count_sort2/test3.xml
383
386
  - test/mabmapper/test_author_statement.rb
384
387
  - test/mabmapper/test_corporate_body_contributor_display.rb
385
388
  - test/mabmapper/test_corporate_body_creator_display.rb
@@ -422,6 +425,7 @@ files:
422
425
  - test/mabmapper/test_title_search.rb
423
426
  - test/mabmapper/test_title_sort.rb
424
427
  - test/mabmapper/test_volume_count_sort.rb
428
+ - test/mabmapper/test_volume_count_sort2.rb
425
429
  - test/test_helper.rb
426
430
  - test/test_mabmapper.rb
427
431
  - utils/mab_by_docid.sh
@@ -659,6 +663,9 @@ test_files:
659
663
  - test/mab_files/test_title_sort/PAD01.000992332.PRIMO.xml
660
664
  - test/mab_files/test_volume_count_sort/PAD01.001015068.PRIMO.xml
661
665
  - test/mab_files/test_volume_count_sort/PAD01.001499879.PRIMO.xml
666
+ - test/mab_files/test_volume_count_sort2/test1.xml
667
+ - test/mab_files/test_volume_count_sort2/test2.xml
668
+ - test/mab_files/test_volume_count_sort2/test3.xml
662
669
  - test/mabmapper/test_author_statement.rb
663
670
  - test/mabmapper/test_corporate_body_contributor_display.rb
664
671
  - test/mabmapper/test_corporate_body_creator_display.rb
@@ -701,5 +708,6 @@ test_files:
701
708
  - test/mabmapper/test_title_search.rb
702
709
  - test/mabmapper/test_title_sort.rb
703
710
  - test/mabmapper/test_volume_count_sort.rb
711
+ - test/mabmapper/test_volume_count_sort2.rb
704
712
  - test/test_helper.rb
705
713
  - test/test_mabmapper.rb