7 |
_debug |
_debug |
8 |
_pack_subfields_hash |
_pack_subfields_hash |
9 |
|
|
10 |
tag search display |
search_display search display |
11 |
|
|
12 |
marc marc_indicators marc_repeatable_subfield |
marc marc_indicators marc_repeatable_subfield |
13 |
marc_compose marc_leader marc_fixed |
marc_compose marc_leader marc_fixed |
14 |
marc_duplicate marc_remove marc_count |
marc_duplicate marc_remove marc_count |
43 |
|
|
44 |
=head1 VERSION |
=head1 VERSION |
45 |
|
|
46 |
Version 0.29 |
Version 0.30 |
47 |
|
|
48 |
=cut |
=cut |
49 |
|
|
50 |
our $VERSION = '0.29'; |
our $VERSION = '0.30'; |
51 |
|
|
52 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
53 |
|
|
60 |
C<perl -c normalize.pl>. |
C<perl -c normalize.pl>. |
61 |
|
|
62 |
Normalisation can generate multiple output normalized data. For now, supported output |
Normalisation can generate multiple output normalized data. For now, supported output |
63 |
types (on the left side of definition) are: C<tag>, C<display>, C<search> and |
types (on the left side of definition) are: C<search_display>, C<display>, C<search> and |
64 |
C<marc>. |
C<marc>. |
65 |
|
|
66 |
=head1 FUNCTIONS |
=head1 FUNCTIONS |
443 |
|
|
444 |
Those functions generally have to first in your normalization file. |
Those functions generally have to first in your normalization file. |
445 |
|
|
446 |
=head2 tag |
=head2 search_display |
447 |
|
|
448 |
Define new tag for I<search> and I<display>. |
Define output for L<search> and L<display> at the same time |
449 |
|
|
450 |
tag('Title', rec('200','a') ); |
search_display('Title', rec('200','a') ); |
451 |
|
|
452 |
|
|
453 |
=cut |
=cut |
454 |
|
|
455 |
sub tag { |
sub search_display { |
456 |
my $name = shift or die "tag needs name as first argument"; |
my $name = shift or die "search_display needs name as first argument"; |
457 |
my @o = grep { defined($_) && $_ ne '' } @_; |
my @o = grep { defined($_) && $_ ne '' } @_; |
458 |
return unless (@o); |
return unless (@o); |
|
$out->{$name}->{tag} = $name; |
|
459 |
$out->{$name}->{search} = \@o; |
$out->{$name}->{search} = \@o; |
460 |
$out->{$name}->{display} = \@o; |
$out->{$name}->{display} = \@o; |
461 |
} |
} |
462 |
|
|
463 |
=head2 display |
=head2 display |
464 |
|
|
465 |
Define tag just for I<display> |
Define output just for I<display> |
466 |
|
|
467 |
@v = display('Title', rec('200','a') ); |
@v = display('Title', rec('200','a') ); |
468 |
|
|
472 |
my $name = shift or die "display needs name as first argument"; |
my $name = shift or die "display needs name as first argument"; |
473 |
my @o = grep { defined($_) && $_ ne '' } @_; |
my @o = grep { defined($_) && $_ ne '' } @_; |
474 |
return unless (@o); |
return unless (@o); |
|
$out->{$name}->{tag} = $name; |
|
475 |
$out->{$name}->{display} = \@o; |
$out->{$name}->{display} = \@o; |
476 |
} |
} |
477 |
|
|
487 |
my $name = shift or die "search needs name as first argument"; |
my $name = shift or die "search needs name as first argument"; |
488 |
my @o = grep { defined($_) && $_ ne '' } @_; |
my @o = grep { defined($_) && $_ ne '' } @_; |
489 |
return unless (@o); |
return unless (@o); |
|
$out->{$name}->{tag} = $name; |
|
490 |
$out->{$name}->{search} = \@o; |
$out->{$name}->{search} = \@o; |
491 |
} |
} |
492 |
|
|
1230 |
$database_code = config(); # use _ from hash |
$database_code = config(); # use _ from hash |
1231 |
$database_name = config('name'); |
$database_name = config('name'); |
1232 |
$database_input_name = config('input name'); |
$database_input_name = config('input name'); |
|
$tag = config('input normalize tag'); |
|
1233 |
|
|
1234 |
Up to three levels are supported. |
Up to three levels are supported. |
1235 |
|
|