| 1 | package MARC::Moose::Formater::UnimarcToMarc21; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 4 | $MARC::Moose::Formater::UnimarcToMarc21::VERSION = '1.0.49'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Convert biblio record from UNIMARC to MARC21 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 4 | extends 'MARC::Moose::Formater'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use List::Util qw/ first /; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 4 | ▶ | use MARC::Moose::Field::Control; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use MARC::Moose::Field::Std; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | # Equivalence UNIMARC author type code > MARC21 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | # Each UNIMARC code points to a array ref which first entry contains MARC21 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | # code and second MARC21 author type description. The second entry isn't used | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | # yet. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 4 | my %authcode = map { /^(\d*) (\w*) (.*)$/; $1 => [$2, $3] } split /\n/, <<EOS; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 005 act actor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 010 adp adapter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 020 ann annotator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 030 arr arranger | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 040 art artist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 050 asg assignee | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 060 asn associated name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 065 auc auctioneer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 070 aut author | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 072 aqt author in quotations or text abstract | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 075 aft author of afterword, colophon, etc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 080 aui author of introd | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 090 aus author of screenplay | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 100 ant bibl. antecedent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 110 bnd binder | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 120 bdd binding designer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 130 bkd book designer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 140 bjd bkjacket designer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 150 bpd bkplate designer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 160 bsl bookseller | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 170 cll calligrapher | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 180 ctg cartographer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 190 cns censor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 200 chr choreographer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 205 clb collaborator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 210 cmm commentator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 212 cwt commentator for written text | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 220 com compiler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 230 cmp composer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 240 cmt compositor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 245 ccp conceptor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 250 cnd conductor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 255 csp consultant to a project | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 260 cph copyright holder | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 270 crr corrector | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 273 cur curator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 275 dnc dancer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 280 dte dedicatee | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 290 dto dedicator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 295 dgg degree grantor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 300 drt director | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 305 dis dissertant | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 310 dst distributor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 320 dnr donor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 330 dub dubious author | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 340 edt editor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 350 egr engraver | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 360 etr etcher | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 365 exp expert | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 370 flm film editor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 380 frg forger | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 390 fmo former owner | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 400 fnd funder | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 410 grt graphic technician | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 420 hnr honoree | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 430 ilu illuminator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 440 ill illustrator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 450 ins inscriber | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 460 ive interviewee | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 470 ivr interviewer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 480 lbt librettist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 490 lse licensee | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 500 lso licensor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 510 ltg lithographer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 520 lyr lyricist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 530 mte metal engraver | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 540 mon monitor/contractor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 545 mus musician | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 550 nrt narrator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 555 opn opponent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 557 orm organizer of meeting | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 560 org originator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 570 oth other | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 580 ppm papermaker | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 582 pta patent applicant | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 584 inv inventor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 587 pth patent holder | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 590 prf performer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 595 res research | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 600 pht photographer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 610 prt printer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 620 pop printer of plates | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 630 pro producer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 635 prg programmer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 640 pfr proofreader | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 650 pbl publisher | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 651 pbd publishing director | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 660 rcp recipient | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 670 rce recording engineer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 673 rth research team head | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 675 rev reviewer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 677 rtm research team member | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 680 rbr rubricator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 690 sce scenarist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 695 sad scientific advisor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 700 scr scribe | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 705 scl sulptor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 710 sec secretary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 720 sgn signer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 721 sng singer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 723 spn sponsor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 725 stn standards body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 727 ths thesis advisor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 730 trl translator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 740 tyd type designer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 750 tyg typographer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 755 voc vocalist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 760 wde wood engraver | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 770 wam writer of accompanying material | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | EOS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | # UNIMARC 100 Type of pub | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 4 | my %typeofpub = map { /(\w) (\w)/; $1 => $2; } split /\n/, <<EOS; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | a c | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | b d | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | c u | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | d s | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | e r | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | f q | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | g m | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | h t | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | i p | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | j e | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | EOS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | # UNIMARC 100 Target Audience Code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 4 | my %target_audience = map { /(\w|\|) (\w|\|)/; $1 => $2; } split /\n/, <<EOS; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | b a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | c b | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | a j | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | d c | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | e d | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | k e | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | m g | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | | | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | EOS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | # List of moved fields unchanged | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 4 | my @unchanged; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 4 | push @unchanged, [$_, 500] for 300..315; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 4 | push @unchanged, [317, 561], | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | [320, 504], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | [321, 500], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | [322, 508], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | [323, 511], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | [324, 500], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | [328, 502], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | [330, 520], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | [332, 524], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | [333, 521], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | [337, 538], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | [371, 506], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | [686, '084']; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | # Tags with non-filing indicator (pos 1 or 2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 4 | my $nonfiling_tags = [ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | [ qw/130 630 730 740 830/ ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | [ qw/240 242 243 245 440 830/ ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | # NSB/NSE characters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 4 | my $ns_characters = [ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | [ "\x08", "\x09" ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | [ "\x88", "\x89" ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | # Procedure 4 Title | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | ▶ | sub procedure_title { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
procedure_title: not called CC=15 SCAR=54.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | my ($self, $subf) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | my ($h_index) = (-1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | my @equivals = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | [ 'a', 'a' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | [ 'j', 'f' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | [ 'n', 'g' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | [ 'h', 'n', '.' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | [ 'k', 'f', '.' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | [ 'l', 'k', '.' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | [ 'm', 'l', '.' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | [ 'q', 's', '.' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | [ 'r', 'r', ',' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | [ 's', 's', ',' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | [ 't', 'o', ';' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | [ 'u', 'r', ',' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | [ 'x', 'x', ',' ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | for ( @$subf ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | if ( my $equival = first { $_->[0] eq $letter } @equivals ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | my ($from, $to, $sep) = @$equival; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | ▶ | if ( $sep && @sf ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$sep and @sf
MC/DC0%0/2
$sep and @sf
$sep
@sf
Truth table0%0/3
A and B
A= $sepB= @sf
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | my $match = $sep; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | $match = '\.' if $match eq '.'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | if ( $sf[-1]->[0] !~ /$match$/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | $sf[-1]->[1] .= $sep; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | push @sf, [ $to => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | ▶ | if ( /e/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 0 | ▶ | next unless @sf; #FIXME warning required | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | ▶ | if ( $sf[-1][0] =~ /a|n|p/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | $sf[-1]->[1] .= ' :'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | push @sf, [ b => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | $sf[-1]->[1] .= " : $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | elsif ( /i/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | ▶ | if ( @sf ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | ▶ | if ( $sf[-1]->[0] eq 'h' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | ▶ | $sf[-1]->[1] .= ',' if $sf[-1]->[1] !~ /,$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | $sf[-1]->[1] .= '.'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | push @sf, [ p => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | return \@sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | ▶ | override 'format' => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=310 SCAR=114.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | my ($self, $unimarc) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | my $record = MARC::Moose::Record->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | $record->_leader(" nam a22 7a 4500"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | my $code008 = '120130t xxu||||| |||| 00| 0 ||| d'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | my @sf040; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | # 001 => 001 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | for my $field ( $unimarc->field('001' ) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | $record->append($field->clone()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | # ISBN 010 => 020 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | for my $field ( $unimarc->field('010') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | if ( /a|z/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | $value =~ s/-//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | push @sf, [ $letter => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | elsif ( /b/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | ▶ | $value = "($value)" unless $value =~ /^\(/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | ▶ | if (@sf) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | $sf[-1]->[1] .= " $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | push @sf, [ c => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | elsif ( /d/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | ▶ | if (@sf) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | $sf[-1]->[1] .= " :"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | push @sf, [ c => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | tag => '020', subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | # ISSN 011 => 022 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | # Except 011$b$d => 365 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | for my $field ( $unimarc->field('011') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | my (@sf, @price); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | $value =~ s/-//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | elsif ( /z/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $value =~ s/-//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | push @sf, [ y => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | elsif ( /b|d/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | $value = "($value)" unless $value =~ /^\(/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | ▶ | my $newlet = $letter eq 'b' ? 'b' : 'd'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | push @price, [ $newlet => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 0 | ▶ | $record->append( MARC::Moose::Field::Std->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | tag => '022', subf => \@sf ) ) if @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | ▶ | $record->append(MARC::Moose::Field::Std->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | tag => '365', subf => \@price ) ) if @price; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | # EAN 076 => 024. Get only $a subfield | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | for my $field ( $unimarc->field('073') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | my $value = $field->subfield('a'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | ▶ | next unless $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | tag => '024', subf => [ [ a => $value ] ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | # 100 => 008 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | if ( my $field = $unimarc->field('100') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | my $code100 = $field->subfield('a'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | ▶ | if ( $code100 && length($code100) > 20 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$code100 and length $code100 > 20
MC/DC0%0/2
$code100 and length $code100 > 20
$code100
length $code100 > 20
Truth table0%0/3
A and B
A= $code100B= length $code100 > 20
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | # Date entered on file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | substr $code008, 0, 6, substr($code100, 2, 6); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | # Type of publication date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | my $value = substr($code100, 8, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | ▶ | $value = $typeofpub{$value} || ' '; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$typeofpub{$value} || ' '
MC/DC0%0/1
$typeofpub{$value} || ' '
$typeofpub{$value}
Truth table0%0/2
A
A= $typeofpub{$value}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | substr $code008, 6, 1, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | # Date 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | $value = substr($code100, 9, 4); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | if ( 1 ) { #FIXME Determine if it's a serials | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | # Not serials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | my $count = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | ▶ | for ( split //, $value ) { $count++ if / /; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | ▶ | $value =~ s/ /0/g if $count <= 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | # A serials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | $value =~ s/ /u/g; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | substr $code008, 7, 4, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | # Date 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | $value = substr($code100, 13, 4); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | if ( 1 ) { #FIXME Determine if it's a serials | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | # Not serials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | my $count = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | ▶ | for ( split //, $value ) { $count++ if / /; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 0 | ▶ | $value =~ s/ /0/g if $count <= 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | # A serials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | $value =~ s/ /u/g; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 0 | substr $code008, 11, 4, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | # 3 positions for target audience | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | $value = substr($code100, 17, 3); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | ▶ | for (my $i=0; $i < 3; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | $value = substr($code100, 17+$i, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 0 | ▶ | $value = $target_audience{$value} || ' '; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$target_audience{$value} || ' '
MC/DC0%0/1
$target_audience{$value} || ' '
$target_audience{$value}
Truth table0%0/2
A
A= $target_audience{$value}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 0 | substr $code008, 17+$i, 1, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | # Language of cataloging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 0 | push @sf040, [ b => substr($code100, 22, 3) ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | # Alphabet of title, converted if serials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | # FIXME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 0 | if ( 0 ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | substrr $code008, 33, 1, substr($code100,34,1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | # Language 101 => 041 and 008 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | ▶ | if ( my $field = $unimarc->field('101') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | # FIXME: à virer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 0 | ▶ | if ( ref($field) eq 'MARC::Moose::Field::Control' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 0 | say $unimarc->as('Text'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 0 | exit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 0 | my @all = @{$field->subf}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | my $count_a = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 0 | my (@sf, @sf_b); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | for (@all) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 9 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 0 | ▶ | next if $count_a >= 6; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | $count_a++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | 0 | ▶ | if ( $count_a == 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | $value .= ' '; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | $value = substr($value, 0, 3); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | substr $code008, 35, 3, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 0 | push @sf, [ a => $value]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | elsif ( /c/ ) { push @sf, [ h => $value ]; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | elsif ( /b/ ) { push @sf_b, $value; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | 0 | elsif ( /d/ ) { push @sf, [ b => $value ]; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 0 | elsif ( /e/ ) { push @sf, [ f => $value ]; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | elsif ( /f|g/ ) { } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 0 | elsif ( /j/ ) { push @sf, [ b => $value ]; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | elsif ( /h/ ) { push @sf, [ e => $value ]; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | 0 | elsif ( /i/ ) { push @sf, [ g => $value ]; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | 0 | ▶ | if ( @sf_b ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | 0 | for ( @sf ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 0 | ▶ | if ($_->[0] eq 'h') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 0 | $_->[1] .= ' ' . join(' ', @sf_b); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 0 | my $ind1 = $field->ind1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | 0 | ▶ | $ind1 = '0' if $ind1 eq ' '; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 0 | ▶ | $ind1 = '1' if $ind1 eq '2'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | tag => '041', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | ind1 => $ind1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | 0 | substr($code008, 35, 3) = '|||'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | # 125 => 008 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | # FIXME: 125$b isn't handled at all | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 0 | ▶ | if ( my $field = $unimarc->field('125') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 0 | my $value = $field->subfield('a'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | my ($pos0, $pos1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 0 | ▶ | $pos0 = substr($value, 0, 1) if $value && length($value) >= 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$value and length $value >= 1
MC/DC0%0/2
$value and length $value >= 1
$value
length $value >= 1
Truth table0%0/3
A and B
A= $valueB= length $value >= 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 0 | ▶ | $pos1 = substr($value, 1, 1) if $value && length($value) >= 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$value and length $value >= 2
MC/DC0%0/2
$value and length $value >= 2
$value
length $value >= 2
Truth table0%0/3
A and B
A= $valueB= length $value >= 2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 0 | ▶ | $pos0 ||= '|'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$pos0 ||= "|"
MC/DC0%0/1
$pos0 ||= "|"
$pos0
Truth table0%0/2
A
A= $pos0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | 0 | ▶ | $pos0 = 'n' if $pos0 eq 'x'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | ▶ | $pos1 ||= '|'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$pos1 ||= "|"
MC/DC0%0/1
$pos1 ||= "|"
$pos1
Truth table0%0/2
A
A= $pos1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | 0 | ▶ | $pos1 = 'n' if $pos1 eq 'x'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | 0 | ▶ | $pos1 = ' ' if $pos1 eq 'y'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 0 | substr($code008, 20, 2) = $pos0 . $pos1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | 0 | $record->append( MARC::Moose::Field::Control->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | tag => '008', value => $code008 ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | # Title | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | for my $field ( $unimarc->field('200') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 0 | my ($a_index, $h_index) = (-1, -1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | SUBFIELD200: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 10 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | 0 | ▶ | if ( $a_index == -1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | 0 | $a_index = $#sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 0 | $sf[$a_index]->[1] .= " ; $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | elsif ( /b/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 0 | ▶ | if ( $h_index == -1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | 0 | push @sf, [ h => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | 0 | $h_index = $#sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 0 | ▶ | if ( $#sf == $h_index ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | 0 | $sf[$h_index]->[1] .= " + $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | 0 | $sf[-1]->[1] .= " ($value)"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | elsif ( /c/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | ▶ | next SUBFIELD200 unless @sf; #FIXME warning required | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | 0 | $sf[-1]->[1] .= ". $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | elsif ( /d/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 0 | ▶ | next SUBFIELD200 unless @sf; #FIXME warning required | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | 0 | ▶ | if ( $sf[-1]->[0] =~ /a|n|p/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | 0 | $sf[-1]->[1] .= ' ='; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 0 | $value =~ s/^= //; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | 0 | push @sf, [ b => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | 0 | $sf[-1]->[1] .= " = $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | elsif ( /e/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | 0 | ▶ | next SUBFIELD200 unless @sf; #FIXME warning required | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 0 | ▶ | if ( $sf[-1]->[0] =~ /a|n|p/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 0 | $sf[-1]->[1] .= ' :'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 0 | push @sf, [ b => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | 0 | $sf[-1]->[1] .= " : $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | elsif ( /f/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | 0 | ▶ | next SUBFIELD200 unless @sf; #FIXME warning required | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | 0 | ▶ | if ( $sf[-1]->[0] =~ /a|b|n|p/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | 0 | $sf[-1]->[1] .= ' /'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 0 | push @sf, [ c => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 0 | $sf[-1]->[1] .= " / $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | elsif ( /g/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | 0 | ▶ | next SUBFIELD200 unless @sf; #FIXME warning required | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 0 | $sf[-1]->[1] .= " ; $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | elsif ( /h/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | 0 | ▶ | next SUBFIELD200 unless @sf; #FIXME warning required | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | 0 | ▶ | if ( $sf[-1]->[0] =~ /a|n|p/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | 0 | $sf[-1]->[1] .= '.'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | 0 | push @sf, [ n => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | #$sf[-1]->[1] .= ". $value"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | 0 | push @sf, [ n => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | elsif ( /i/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 | ▶ | next SUBFIELD200 unless @sf; #FIXME warning required | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | 0 | ▶ | if ( @sf && $sf[-1]->[0] =~ /a|n|p/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@sf and $sf[-1][0] =~ /a|n|p/
MC/DC0%0/2
@sf and $sf[-1][0] =~ /a|n|p/
@sf
$sf[-1][0] =~ /a|n|p/
Truth table0%0/3
A and B
A= @sfB= $sf[-1][0] =~ /a|n|p/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | 0 | $sf[-1]->[1] .= ','; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 0 | push @sf, [ p => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 0 | $sf[-1]->[1] .= ". $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | 0 | elsif ( /v|z|5|6|7/ ) { next SUBFIELD200 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | 0 | ▶ | next unless @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 0 | ▶ | $sf[$h_index]->[1] = '[' . $sf[$h_index]->[1] . ']' unless $h_index == -1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | # Point final | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 0 | ▶ | if (@sf) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | 0 | my $last_value = $sf[-1][1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | 0 | my $last_char = substr($last_value, length($last_value)-1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | 0 | ▶ | $sf[-1][1] = "$last_value." if $last_char !~ /[.?,;:]/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | # Indicators | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | 0 | my ($ind1, $ind2) = ($field->ind1, 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 0 | for ($ind1) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 0 | ▶ | if ( /0/ ) { } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | elsif ( /1/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | #FIXME Test marc21 100/110/111/130 presence | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | 0 | ▶ | $ind1 = $unimarc->field('700|710' ) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 0 | else { $ind1 = 1; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | tag => '245', ind1 => $ind1, ind2 => $ind2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | # TODO 204 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | # 205 => 250 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | 0 | for my $field ($unimarc->field('205') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | 0 | my ($a_index, $b_index) = (-1, -1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | 0 | ▶ | if ( $a_index == -1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | 0 | $a_index = $#sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | 0 | $sf[$a_index]->[1] .= ", $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | elsif ( /b/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | 0 | ▶ | if ( @sf ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | 0 | $sf[-1]->[1] .= ", $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | 0 | $a_index = $#sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | elsif ( /d/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | 0 | ▶ | if ( $b_index == -1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | 0 | push @sf, [ b => $value]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | 0 | $b_index = $#sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | 0 | $sf[-1]->[1] .= " $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | elsif ( /f/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | 0 | ▶ | if ( $b_index == -1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | 0 | ▶ | $sf[-1]->[1] .= " / " if @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | 0 | push @sf, [ b => $value]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | 0 | $b_index = $#sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | 0 | $sf[-1]->[1] .= " / $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | elsif ( /g/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | 0 | ▶ | if ( @sf ) { $sf[-1]->[1] .= " / $value"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | 0 | else { push @sf, [ a => $value ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | 0 | ▶ | next unless @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | 0 | ▶ | if ( $b_index >= 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | 0 | my $value = $sf[$b_index]->[1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | 0 | ▶ | if ( $value =~ /= $/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | 0 | $value =~ s/= $//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | 0 | $sf[$b_index]->[1] = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | 0 | $sf[$b_index-1]->[1] .= '= '; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | # Point final | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | 0 | ▶ | $sf[-1][1] = $sf[-1][1] . '.' if @sf && $sf[-1][1] !~ /\.$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@sf and not $sf[-1][1] =~ /\.$/
MC/DC0%0/2
@sf and not $sf[-1][1] =~ /\.$/
@sf
not $sf[-1][1] =~ /\.$/
Truth table0%0/3
A and not(B)
A= @sfB= not $sf[-1][1] =~ /\.$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | tag => '250', ind1 => $field->ind1, ind2 => $field->ind2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | # TODO 206 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | # 207 => 362 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | 0 | for my $field ($unimarc->field('207') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | 0 | my $a_index = -1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | 0 | ▶ | if ( $a_index == -1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | 0 | $a_index = $#sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | 0 | my $prev = $sf[$a_index]->[1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | 0 | $prev =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | 0 | $prev =~ s/;$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | 0 | $prev =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | 0 | $sf[$a_index]->[1] = "$prev ; $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | elsif ( /v/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | 0 | push @sf, [ z => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | 0 | ▶ | next unless @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | # Point at the end | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | 0 | ▶ | $sf[-1][1] = $sf[-1][1] . '.' if @sf && $sf[-1][1] !~ /\.$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@sf and not $sf[-1][1] =~ /\.$/
MC/DC0%0/2
@sf and not $sf[-1][1] =~ /\.$/
@sf
not $sf[-1][1] =~ /\.$/
Truth table0%0/3
A and not(B)
A= @sfB= not $sf[-1][1] =~ /\.$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | tag => '362', ind2 => $field->ind1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 685 | subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 686 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 687 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 688 | #TODO 208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 689 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 690 | # 210/214 => 260 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | 0 | for my $field ( $unimarc->field('210|214') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 694 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 695 | 0 | $value =~ s/^ *//, $value =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 696 | 0 | my %found; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 697 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 698 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 12 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 699 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 700 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 701 | elsif ( /b/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 702 | 0 | ▶ | $value = "($value)" if $value !~ /^\(/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 703 | 0 | ▶ | if ( @sf ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 704 | 0 | $sf[-1]->[1] .= " $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 705 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 706 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 707 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | elsif ( /c/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 711 | 0 | push @sf, [ b => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 712 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 713 | elsif ( /d/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 714 | 0 | push @sf, [ c => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 715 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 716 | elsif ( /e/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 717 | 0 | push @sf, [ e => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 718 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 719 | elsif ( /f/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 720 | 0 | ▶ | unless ( $found{$letter} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 721 | 0 | $found{$letter} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 722 | 0 | ▶ | $sf[-1]->[1] .= ", $value" if @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 723 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 724 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 725 | elsif ( /g/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 726 | 0 | ▶ | unless ( $found{$letter} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 727 | 0 | $found{$letter} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 728 | 0 | push @sf, [ f => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 729 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 730 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 731 | elsif ( /h/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 732 | 0 | ▶ | unless ( $found{$letter} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 733 | 0 | $found{$letter} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 734 | 0 | push @sf, [ g => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 735 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 736 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 737 | elsif ( /j/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 738 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 739 | tag => '265', subf => [ a => $value ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 740 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 741 | elsif ( /k/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 742 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 743 | tag => '265', ind1 => '0', ind2 => '0', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 744 | subf => [ a => $value ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 745 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | elsif ( /l/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | tag => '265', ind1 => '1', ind2 => '0', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | subf => [ [ a => $value ] ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | elsif ( /m/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | tag => '265', ind1 => '2', ind2 => '0', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | subf => [ a => $value ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | 0 | ▶ | next unless @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | # Ponctuation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | 0 | ▶ | for (my $i=0; $i < @sf; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | 0 | my ($letter, $value) = @{$sf[$i]}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | 0 | ▶ | $sf[$i-1]->[1] .= ' ;' if $i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | elsif ( /b|f/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | 0 | ▶ | $sf[$i-1]->[1] .= ' :' if $i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | elsif ( /c|g/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | 0 | ▶ | $sf[$i-1]->[1] .= ',' if $i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | 0 | ▶ | $value = "($value)" if $letter =~ /e|f|g/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | 0 | ▶ | if ( $value =~ /^= / ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | 0 | $value =~ s/^= //; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | 0 | ▶ | $sf[$i-1]->[1] .= ' =' if $i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | 0 | $sf[$i]->[1] = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | 0 | ▶ | $sf[-1][1] = $sf[-1][1] . '.' if @sf && $sf[-1][1] !~ /\.$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@sf and not $sf[-1][1] =~ /\.$/
MC/DC0%0/2
@sf and not $sf[-1][1] =~ /\.$/
@sf
not $sf[-1][1] =~ /\.$/
Truth table0%0/3
A and not(B)
A= @sfB= not $sf[-1][1] =~ /\.$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | 0 | $record->append( MARC::Moose::Field::Std->new( tag => '260', subf => \@sf ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | # TODO 211 => 263 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | # 215 => 300 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | 0 | for my $field ( $unimarc->field('215') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | SUBFIELD215: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | 0 | $value =~ s/^ *//, $value =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | 0 | ▶ | if ( /c/ ) { $letter = 'b'; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | 0 | elsif ( /d/ ) { $letter = 'c'; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | 0 | elsif ( /6|7/ ) { next SUBFIELD215; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | 0 | push @sf, [ $letter => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | 0 | ▶ | next unless @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | # Ponctuation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | 0 | ▶ | for (my $i=1; $i < @sf; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | 0 | my ($letter, $value) = @{$sf[$i]}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | 0 | ▶ | if ( /b/ ) { $sf[$i-1]->[1] .= ' :'; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | 0 | elsif ( /c/ ) { $sf[$i-1]->[1] .= ' ;'; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | 0 | elsif ( /e/ ) { $sf[$i-1]->[1] .= ' + '; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | 0 | ▶ | $sf[-1][1] = $sf[-1][1] . '.' if $sf[-1][1] !~ /\.$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | 0 | $record->append( MARC::Moose::Field::Std->new( tag => '300', subf => \@sf ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | # 225 => 490 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | 0 | for my $field ( $unimarc->field('225') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | 0 | my (@sf, @a, @vx); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | 0 | my $prev_letter = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | 0 | $value =~ s/^ *//, $value =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | 0 | $value =~ s/\x88//g, $value =~ s/\x89//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | 0 | ▶ | if ( /a/ ) { push @a, $value; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 7 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | 0 | elsif ( /d/ ) { push @a, " = $value" } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | 0 | elsif ( /e/ ) { push @a, " : $value" } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | 0 | elsif ( /f/ ) { push @a, " / $value" } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | 0 | elsif ( /h/ ) { push @a, ". $value" } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | elsif ( /i/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | 0 | ▶ | push @a, $prev_letter eq 'h' ? ", $value " : ". $value"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | 0 | elsif ( /v|x/ ) { push @vx, [ $letter => $value ] } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | 0 | $prev_letter = $letter; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | 0 | ▶ | next unless @a; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | 0 | push @sf, [ a => join('', @a) ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | 0 | push @sf, @vx; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | 0 | ▶ | $record->append( MARC::Moose::Field::Std->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | tag => '490', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | ind1 => $field->ind1 =~ /0|2/ ? 1 : 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | # 230 => 256 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | 0 | for my $field ( $unimarc->field('230') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | 0 | $record->append($field->clone('256')); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | # Unchanged fields | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | 0 | for my $fromto ( @unchanged ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | 0 | my ($from, $to) = @$fromto; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | 0 | for my $field ( $unimarc->field($from) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | 0 | $record->append($field->clone($to)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | # 325 => 533 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | 0 | for my $field ( $unimarc->field('325') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | tag => '533', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | subf => [ [ n => $field->subfield('a') ] ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | # 326 => 533 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | 0 | for my $field ( $unimarc->field('326') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | # FIXME Should be done depending on biblio record type: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | # MAP, SERIALS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | 0 | my $type = 'SERIALS'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | 0 | my $new_field; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | 0 | ▶ | if ( $type =~ /SERIALS/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | 0 | $new_field = $field->clone('310'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | 0 | $record->append($new_field); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | # 327 => 505 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | 0 | for my $field ( $unimarc->field('327') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | 0 | my $ind1 = $field->ind1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 879 | 0 | ▶ | $ind1 = 0 if $ind1 =~ /1/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 880 | 0 | ▶ | $ind1 = 1 if $ind1 =~ /0/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | 0 | my @a = map { $_->[1] } @{$field->subf}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 883 | tag => '505', ind1 => $ind1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 884 | subf => [ [ a => join(' ', @a) ] ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 885 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 886 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 887 | # 329 => 505 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 888 | # This is French (CCfr) specific field without equivalent in MARC21 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 889 | # Concatained into 505 field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 890 | 0 | for my $field ( $unimarc->field('359') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 891 | 0 | my @a = map { $_->[1] } @{$field->subf}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 892 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | tag => '505', ind1 => '0', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | subf => [ [ a => join(' -- ', @a) ] ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 896 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 897 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 898 | # 336 => 500 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 899 | 0 | for my $field ( $unimarc->field('336') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 900 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 901 | tag => '500', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 902 | subf => [ [ a => 'Type of computer file: ' . $field->subfield('a') ] ] ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 903 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 904 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 905 | # 345 => 037 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 906 | 0 | for my $field ( $unimarc->field('345') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 907 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | 0 | ▶ | $letter = $letter eq 'a' ? 'b' : | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | $letter eq 'b' ? 'a' : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | $letter eq 'c' ? 'f' : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | $letter eq 'd' ? 'c' : $letter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | 0 | push @sf, [ $letter => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | tag => '037', subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | # TODO 410 411 421 422 423 430 431 432 433 434 435 436 437 440 441 442 443 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | # 444 445 446 447 448 451 452 453 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 923 | # 454 => 765 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 924 | 0 | for my $ft ( ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 925 | [410, 760], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 926 | [411, 762], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 927 | [421, 770], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 928 | [422, 772], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 929 | [423, 777], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 930 | [430, 780, 0], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 931 | [431, 780, 1], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 932 | [432, 780, 2], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 933 | [433, 780, 3], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 934 | [434, 780, 5], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 935 | [435, 780, 6], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 936 | [436, 780, 4], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 937 | [437, 780, 7], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 938 | [440, 785, 0], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 939 | [441, 785, 1], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 940 | [442, 785, 2], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 941 | [443, 785, 3], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 942 | [444, 785, 4], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 943 | [445, 785, 5], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 944 | [446, 785, 6], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 945 | [447, 785, 7], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 946 | [448, 785, 8], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 947 | [451, 775], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 948 | [452, 776], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 949 | [453, 767], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 950 | [454, 765], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 951 | [455, 787, 8, 'Reproduction of:'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 952 | [456, 787, 8, 'Reproduced as:'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 953 | [461, 773], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 954 | [462, 774], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 955 | [463, 773], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 956 | [464, 774], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 957 | [470, 787, 8, 'Item reviewed:'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 958 | [488, 787, 8, 'Reproduced as:'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 959 | [491, 774], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 960 | [492, 774], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 961 | [493, 773], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 962 | [494, 773], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 963 | ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 964 | 0 | my ($from, $to, $ind2, $text) = @$ft; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 965 | 0 | ▶ | $ind2 = ' ' unless $ind2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 966 | 0 | for my $field ( $unimarc->field($from) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 967 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 968 | 0 | ▶ | push @sf, [ i => $text ] if $text; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 969 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 970 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 971 | 0 | ▶ | if ( $letter eq 't') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 972 | 0 | $value =~ s/\x{0088}//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 973 | 0 | $value =~ s/\x{0089}//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 974 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 975 | 0 | ▶ | $letter = $letter eq '1' ? 'a' : | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 976 | $letter eq '3' ? 'w' : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 977 | $letter eq 'v' ? 'g' : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 978 | $letter eq 'y' ? 'z' : $letter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 979 | 0 | push @sf, [ $letter => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 980 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 981 | 0 | ▶ | my $ind1 = $field->ind2 =~ /0/ ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 982 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 983 | tag => $to, ind1 => $ind1, ind2 =>$ind2, subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 984 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 985 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 986 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 987 | # 500 => 240 or 130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 988 | 0 | for my $field ( $unimarc->field('500|503|517|540|541') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 989 | 0 | my ($ind1, $ind2) = ($field->ind1, $field->ind2); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 990 | 0 | my $tag = '240'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 991 | 0 | ▶ | if ( $ind2 eq '0' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 992 | 0 | $ind2 = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 993 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 994 | elsif ( $ind2 eq '1' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 995 | 0 | $tag = '130'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 996 | 0 | ($ind1, $ind2) = (0, ' '); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 997 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 998 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 999 | 0 | ($ind1, $ind2) = (1, 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1000 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1001 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1002 | tag => $tag, ind1 => $ind1, ind2 => $ind2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1003 | subf => $self->procedure_title($field->subf) ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1004 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1005 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1006 | # 545 => 773, on passe t en a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1007 | 0 | for my $field ( $unimarc->field('545') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1008 | 0 | $field->tag('773'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1009 | 0 | ▶ | $field->subf( [ grep { $_->[0] = 't' if $_->[0] eq 'a'; $_ } @{$field->subf} ] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1010 | 0 | $record->append( $field ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1011 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1012 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1013 | # 600 => 600 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1014 | # Suppr 6 et 7. f => d | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1015 | 0 | for my $field ( $unimarc->field('600') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1016 | 0 | my @names; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1017 | my $date; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1018 | # Skip $6 and $7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1019 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1020 | 0 | my $date_available = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1021 | SUBFIELD600: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1022 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1023 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1024 | 0 | $value =~ s/^ *//; $value =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1025 | 0 | ▶ | next unless $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1026 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1027 | 0 | ▶ | if ( /6|7/ ) { next SUBFIELD600; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1028 | 0 | elsif ( /a|b/ ) { push @names, $value; next; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1029 | 0 | elsif ( /f/ ) { $date_available = 1; $letter = 'd'; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1030 | 0 | elsif ( /y/ ) { $letter = 'z'; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1031 | 0 | elsif ( /z/ ) { $letter = 'y'; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1032 | 0 | push @sf, [ $letter => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1033 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1034 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1035 | 0 | my @sf_complete; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1036 | 0 | my $notpushed = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1037 | 0 | for (@sf) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1038 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1039 | 0 | ▶ | if ($letter gt 'a' && $notpushed) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$letter gt "a" and $notpushed
MC/DC0%0/2
$letter gt "a" and $notpushed
$letter gt "a"
$notpushed
Truth table0%0/3
A and B
A= $letter gt "a"B= $notpushed
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1040 | 0 | ▶ | push @sf_complete, [ a => join(', ', @names) . ($date_available ? ',' : '') ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1041 | 0 | $notpushed = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1042 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1043 | 0 | push @sf_complete, $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1044 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1045 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1046 | tag => '600', subf => \@sf_complete ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1047 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1048 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1049 | # 605 => 630 - 606 => 650 - 607 => 651 - 608 => 650 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1050 | # On conserve à leur place les lettres a x j (subdivision de forme) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1051 | # On inverse y et z. et déplacée en v. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1052 | # On suppr les $3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1053 | 0 | for my $fromto ( ( [601, 650], [604, 600], [605, 630], [606, 650], [607, 651], [608, 650] ) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1054 | 0 | my ($from, $to) = @$fromto; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1055 | 0 | for my $field ( $unimarc->field($from) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1056 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1057 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1058 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1059 | 0 | $value =~ s/^ *//, $value =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1060 | 0 | ▶ | next if $letter =~ /3/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1061 | 0 | ▶ | if ( $letter eq 'j' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1062 | 0 | $letter = 'v'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1063 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1064 | elsif ( $letter eq 'y' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1065 | 0 | $letter = 'z'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1066 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1067 | elsif ( $letter eq 'z' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1068 | 0 | $letter = 'y'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1069 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1070 | 0 | push @sf, [ $letter => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1071 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1072 | 0 | ▶ | next unless @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1073 | 0 | ▶ | $sf[-1][1] = $sf[-1][1] . '.' if $sf[-1][1] !~ /\.$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1074 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1075 | tag => $to, subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1076 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1077 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1078 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1079 | # 675 => 080, $v and $z aren't converted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1080 | 0 | for my $field ( $unimarc->field('675') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1081 | 0 | my @sf = grep { $_->[0] !~ /v|z/; } @{$field->subf}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1082 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1083 | tag => '080', subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1084 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1085 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1086 | # 676 => 082, $v => $2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1087 | 0 | for my $field ( $unimarc->field('676') ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1088 | 0 | ▶ | my @sf = map { $_->[0] = '2' if $_->[0] eq 'v'; $_; } @{$field->subf}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1089 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1090 | tag => '082', subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1091 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1092 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1093 | # Les auteurs 700 => 100, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1094 | # Suppr sous $3, $6 et $7 $9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1095 | 0 | for my $fromto ( ( [700, 100], [701, 700], [702, 700] ) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1096 | 0 | my ($from, $to) = @$fromto; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1097 | 0 | for my $field ( $unimarc->field($from) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1098 | 0 | my $ind1 = $field->ind2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1099 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1100 | my @codes; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1101 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1102 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1103 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1104 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 7 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1105 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1106 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1107 | elsif ( /b/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1108 | 0 | ▶ | if ( @sf ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1109 | 0 | $sf[-1]->[1] .= ", $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1111 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1112 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1114 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1115 | elsif ( /c/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1116 | 0 | $sf[-1]->[1] .= ','; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1117 | 0 | push @sf, [ c => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1118 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1119 | elsif ( /d/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1120 | 0 | push @sf, [ b => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1122 | elsif ( /f/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1123 | 0 | ▶ | $sf[-1]->[1] .= ',' if @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1124 | 0 | push @sf, [ d => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1125 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1126 | elsif ( /g/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1127 | 0 | $sf[-1]->[1] .= '('; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1128 | 0 | push @sf, [ q => "$value)" ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1129 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1130 | elsif ( /4/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1131 | 0 | ▶ | next if $from eq '700' && $value eq '070'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$from eq 700 and $value eq "070"
MC/DC0%0/2
$from eq 700 and $value eq "070"
$from eq 700
$value eq "070"
Truth table0%0/3
A and B
A= $from eq 700B= $value eq "070"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1132 | 0 | my $code = $authcode{$value}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1133 | 0 | ▶ | next unless $code; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1134 | 0 | push @codes, $code->[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1135 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1137 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1138 | 0 | ▶ | next unless @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1139 | 0 | my $value = $sf[-1]->[1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1140 | 0 | $value =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1141 | 0 | $value =~ s/\.*$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1142 | 0 | ▶ | $value .= '.' if $value !~ /[-\?]$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1143 | 0 | $sf[-1]->[1] = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1144 | 0 | push @sf, [ 4 => $_ ] for @codes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1145 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1146 | tag => $to, ind1 => $field->ind2, subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1147 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1150 | # Les collectivités | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1151 | # Suppr sous $3, $6 et $7 $9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1152 | SUBFIELD_CORPORATE: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1153 | 0 | for my $fromto ( ( [710, 110, 111], [711, 710, 711], [712, 710, 711] ) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1154 | 0 | my ($from, $to_corporate, $to_meeting) = @$fromto; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1155 | 0 | for my $field ( $unimarc->field($from) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1156 | 0 | my @sf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1157 | my @codes; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1158 | 0 | for ( @{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1159 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1160 | 0 | for ($letter) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1161 | 0 | ▶ | if ( /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 9 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1162 | 0 | push @sf, [ a => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1164 | elsif ( /g/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1165 | 0 | ▶ | $value = "($value)" unless $value =~ /^\(/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1166 | 0 | ▶ | $sf[-1]->[1] .= " $value" if @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1168 | elsif ( /h/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1169 | 0 | $sf[-1]->[1] .= " $value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1170 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1171 | elsif ( /g/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1172 | 0 | $sf[-1]->[1] .= " ($value)"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1173 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1174 | elsif ( /b/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1175 | 0 | ▶ | if ( @sf ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1176 | 0 | ▶ | $sf[-1]->[1] .= '.' unless $sf[-1]->[1] =~ /\.$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1177 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1178 | 0 | push @sf, [ b => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1179 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1180 | elsif ( /d/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1181 | 0 | ▶ | $value = "($value" unless $value =~ /^\(/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1182 | 0 | push @sf, [ n => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1183 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1184 | elsif ( /e/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1185 | 0 | $value = " :$value)"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1186 | 0 | push @sf, [ c => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1187 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1188 | elsif ( /f/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1189 | 0 | ▶ | $value = $sf[-1]->[0] eq 'n' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1190 | ? " :$value" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1191 | : "($value" if @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1192 | 0 | push @sf, [ d => $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1193 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1194 | elsif ( /4/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1195 | 0 | ▶ | next SUBFIELD_CORPORATE if $from eq '700' && $value eq '070'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$from eq 700 and $value eq "070"
MC/DC0%0/2
$from eq 700 and $value eq "070"
$from eq 700
$value eq "070"
Truth table0%0/3
A and B
A= $from eq 700B= $value eq "070"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1196 | 0 | my $code = $authcode{$value}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1197 | 0 | ▶ | next SUBFIELD_CORPORATE unless $code; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1198 | 0 | push @codes, $code->[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1199 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1201 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1202 | 0 | ▶ | next unless @sf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1203 | 0 | my $value = $sf[-1]->[1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1204 | 0 | $value =~ s/ *$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1205 | 0 | $value =~ s/\.*$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1206 | 0 | $value .= '.'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1207 | 0 | $sf[-1]->[1] = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1208 | 0 | push @sf, [ 4 => $_ ] for @codes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1209 | 0 | ▶ | my $to = $field->ind1 eq '1' ? $to_meeting : $to_corporate; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1210 | 0 | $record->append( MARC::Moose::Field::Std->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1211 | tag => $to, ind1 => $field->ind2, subf => \@sf ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1213 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1214 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1215 | # Populate non-filing indicator based on UNIMARC NSB/NSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1216 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1217 | 0 | my $first = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1218 | 0 | for my $tags (@$nonfiling_tags) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1219 | 0 | for my $tag (@$tags) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1220 | 0 | for my $field ($record->field($tag)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1221 | 0 | for (@{$field->subf}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1222 | 0 | ▶ | next if $_->[0] ne 'a'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1223 | # Found Main title | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1224 | 0 | my $title = $_->[1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1225 | 0 | ▶ | next unless $title; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1226 | 0 | for my $ns (@$ns_characters) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1227 | 0 | my ($nsb, $nse) = @$ns; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1228 | 0 | ▶ | next if $title !~ /^$nsb(.*)$nse(.)/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1229 | 0 | my $len = length($1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1230 | 0 | ▶ | $len++ if $2 eq ' '; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1231 | 0 | ▶ | $len = 0 if $len >= 10; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1232 | 0 | $title =~ s/$nsb//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1233 | 0 | $title =~ s/$nse//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1234 | 0 | $_->[1] = $title; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1235 | 0 | ▶ | if ($first) { $field->ind1($len); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1236 | 0 | else { $field->ind2($len); } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1237 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1238 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1239 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1240 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1241 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1242 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1243 | 0 | $first = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1244 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1245 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1247 | # Some fields are kept, as they are: 856, 801, 9xx | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1248 | 0 | ▶ | if ( my @fields = $unimarc->field('801|856|9..') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1249 | 0 | $record->append(@fields) | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1250 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1251 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1252 | # Clean non-filing characters in all fields | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1253 | 0 | for my $field (@{$record->fields}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1254 | 0 | ▶ | next if ref $field eq 'MARC::Moose::Field::Control'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1255 | 0 | for (@{$field->subf} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1256 | 0 | ▶ | next if $_->[0] !~ /[a-z0-9]/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1257 | 0 | $_->[1] =~ s/\x08|\x09//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1258 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1259 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1261 | 0 | return $record; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1262 | 4 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1264 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1266 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1267 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1268 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||