Support awards in I5
Change-Id: I9b270d6259e24c8e0d5aa3698c3ec608ec082f69
diff --git a/Changes b/Changes
index b2c930e..22e1b4a 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+0.57 2024-07-25
+ - Support award notes in i5.
+
0.56 2024-06-05
- Add support für corpusexplorer.
diff --git a/lib/KorAP/XML/Krill.pm b/lib/KorAP/XML/Krill.pm
index e8f10c4..a613292 100644
--- a/lib/KorAP/XML/Krill.pm
+++ b/lib/KorAP/XML/Krill.pm
@@ -16,7 +16,7 @@
our @EXPORT_OK = qw(get_file_name get_file_name_from_glob);
-our $VERSION = '0.56';
+our $VERSION = '0.57';
has 'path';
has [qw/text_sigle doc_sigle corpus_sigle/];
diff --git a/lib/KorAP/XML/Meta/I5.pm b/lib/KorAP/XML/Meta/I5.pm
index ec9eb5b..66765de 100644
--- a/lib/KorAP/XML/Meta/I5.pm
+++ b/lib/KorAP/XML/Meta/I5.pm
@@ -501,6 +501,13 @@
};
};
+ $dom->find('biblStruct > note[type=award][subtype]')->each(
+ sub {
+ $self->{K_award} //= [];
+ push @{$self->{K_award}}, $_->attr('subtype');
+ }
+ );
+
# DGD treatment
if ($self->{T_title} && !$self->{A_externalLink} && $self->{_corpus_sigle} =~ /^(?:[AD]GD|FOLK)$/) {
my $transcript = $self->{T_title};
@@ -631,6 +638,7 @@
sourceDesc reference[type=complete] reference ATTACHMENT
textDesc > column textColumn STRING
biblStruct biblScope[type=pp] srcPages ATTACHMENT
+ biblStruct > note[type=award][subtype] award KEYWORD
biblNote[n=url] textExternalLink
& @rend ATTACHMENT
biblNote[n="url.ids"] textInternalLink
diff --git a/t/real/bzk_2.t b/t/real/bzk_2.t
index 98316e1..d250a7c 100644
--- a/t/real/bzk_2.t
+++ b/t/real/bzk_2.t
@@ -38,6 +38,9 @@
is($meta->{D_pub_date}, '19590219', 'PubDate');
ok(!$meta->{A_publisher}, 'Publisher');
+is($meta->{K_award}->[0], 'Deutscher Buchpreis 2023', 'Award');
+is($meta->{K_award}->[1], 'Booker price 2024', 'Award');
+
is($meta->{S_text_type}, 'Zeitung: Tageszeitung', 'Correct Text Type');
ok(!$meta->{S_text_type_art}, 'Correct Text Type Art');
diff --git a/t/real/corpus/BZK/D59/00089/header.xml b/t/real/corpus/BZK/D59/00089/header.xml
index 4317556..b140a57 100644
--- a/t/real/corpus/BZK/D59/00089/header.xml
+++ b/t/real/corpus/BZK/D59/00089/header.xml
@@ -34,6 +34,8 @@
<biblScope type="issue"/>
<biblScope type="issueplace">Berliner Ausgabe</biblScope>
</monogr>
+ <note type="award" subtype="Deutscher Buchpreis 2023"/>
+ <note type="award" subtype="Booker price 2024"/>
</biblStruct>
<reference type="complete" assemblage="regular">BZK/D59.00089 Neues Deutschland, [Tageszeitung], 19.02.1959, Jg. 14, Berliner Ausgabe, S. 7. - Sachgebiet: Politik, Originalressort: POLITIK; Saragat-Partei zerfällt</reference>
<reference type="short" assemblage="regular">BZK/D59.00089 Neues Deutschland, 19.02.1959, S. 7</reference>