Skip to content

Commit

Permalink
Support externalLink and internalLink universally in i5 meta
Browse files Browse the repository at this point in the history
Change-Id: If44998b587706813f39f74012f6864180505e9d0
  • Loading branch information
Akron committed Mar 8, 2022
1 parent 2e840a7 commit 3c9b27c
Show file tree
Hide file tree
Showing 9 changed files with 2,235 additions and 18 deletions.
4 changes: 3 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
0.45 2022-02-24
0.45 2022-03-04
- Due to problems installing Archive::Tar::Builder
in certain environments, this is now optional,
with a pure perl fallback archiver.
- Support externalLink and internalLink universally in
i5 meta data.

0.44 2022-02-17
- Improve Gingko Metadata support.
Expand Down
20 changes: 11 additions & 9 deletions lib/KorAP/XML/Meta/Gingko.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,17 @@ sub parse {
$self->{S_gingko_collection_short} = $temp if $temp;
};

if ($temp = $mono->at('biblNote[n="url"]')) {
$temp = $squish->($temp->all_text);
$self->{A_external_link} = $self->korap_data_uri($temp, title => 'Gingko-Webseite an der Universität Leipzig');
};

if ($temp = $mono->at('biblNote[n="url.ids"]')) {
$temp = $squish->($temp->all_text);
$self->{A_internal_link} = $self->korap_data_uri($temp, title => 'IDS webpage on Gingko in the DeReKo archive');
};
# if ($temp = $mono->at('biblNote[n="url"]')) {
# my $title = $temp->attr('rend') || 'Gingko-Webseite an der Universität Leipzig';
# $temp = $squish->($temp->all_text);
# $self->{A_external_link} = $self->korap_data_uri($temp, title => $title);
# };

# if ($temp = $mono->at('biblNote[n="url.ids"]')) {
# my $title = $temp->attr('rend') || 'IDS webpage on Gingko in the DeReKo archive';
# $temp = $squish->($temp->all_text);
# $self->{A_internal_link} = $self->korap_data_uri($temp, title => $title);
# };

};
};
Expand Down
12 changes: 12 additions & 0 deletions lib/KorAP/XML/Meta/I5.pm
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ sub parse {
$sub_title = $sub_title ? _squish $sub_title->all_text : undef;
$author = $author ? _squish $author->all_text : undef;

if (my $temp = $analytic->at('biblNote[n="url"]')) {
my $url = _squish $temp->all_text;
my $title = $temp->attr('rend') || $url;
$self->{"A_${type}_external_link"} = $self->korap_data_uri($url, title => $title);
};

if (my $temp = $analytic->at('biblNote[n="url.ids"]')) {
my $url = _squish $temp->all_text;
my $title = $temp->attr('rend') || $url;
$self->{"A_${type}_internal_link"} = $self->korap_data_uri($url, title => $title);
};

# Text meta data
if ($type eq 'text') {
unless ($self->{T_title} || $self->{T_sub_title}) {
Expand Down
2 changes: 1 addition & 1 deletion script/korapxml2krill
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ use Fcntl qw(:flock SEEK_END);
# - Introduced support for Gingko
# ----------------------------------------------------------

our $LAST_CHANGE = '2022/02/24';
our $LAST_CHANGE = '2022/03/04';
our $LOCAL = $FindBin::Bin;
our $KORAL_VERSION = 0.03;
our $VERSION_MSG = <<"VERSION";
Expand Down
Loading

0 comments on commit 3c9b27c

Please sign in to comment.