Skip to content

Commit

Permalink
Interpret number as integer
Browse files Browse the repository at this point in the history
Change-Id: Id069cb73ff7359d18880c6195bd9159a7c7467b6
  • Loading branch information
Akron committed Jun 6, 2024
1 parent 5530a55 commit ab9e14e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/KorAP/XML/Meta/I5.pm
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,9 @@ sub parse {
$key = 'A_';
my $title = $_->att('desc');
$value = $self->korap_data_uri($value, title => ($title // $value));
} elsif ($xtype eq 'number') {
$self->log->warn('Number currently not supported as xenodata type, treated as string');
$key = 'S_';
# Maybe render as Integer - but it's understood as a string
} elsif ($xtype eq 'integer' || $xtype eq 'number') {
$self->log->warn('Number is treated as integer');
$key = 'I_';
} else {
$self->log->warn('Unknown xenodata type: ' . $xtype);
return;
Expand Down
2 changes: 1 addition & 1 deletion t/real/corpusexplorer.t
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ok(!$meta->{T_doc_sub_title}, 'Correct Doc sub title');
ok(!$meta->{T_doc_author}, 'Correct Doc author');
ok(!$meta->{A_doc_editor}, 'Correct doc editor');

is($meta->{S_Jahr},'2003', 'XenoData');
is($meta->{I_Jahr},'2003', 'XenoData');
is($meta->{T_Person},'Johannes Rau', 'XenoData');
is($meta->{T_GUID},'5d6a6c99-23b5-47eb-902f-f646ef7e24f5', 'XenoData');

Expand Down

0 comments on commit ab9e14e

Please sign in to comment.