View | Details | Raw Unified | Return to bug 16245
Collapse All | Expand All

(-)a/C4/Ris.pm (-37 / +47 lines)
Lines 349-389 sub print_typetag { Link Here
349
    ## of the leader of a MARC record, the values are the RIS types
349
    ## of the leader of a MARC record, the values are the RIS types
350
    ## that might appropriately represent these types.
350
    ## that might appropriately represent these types.
351
    my %ustypehash = (
351
    my %ustypehash = (
352
		    "a" => "BOOK",
352
            "a" => "BOOK",
353
		    "c" => "MUSIC",
353
            "c" => "MUSIC",
354
		    "d" => "MUSIC",
354
            "d" => "MUSIC",
355
		    "e" => "MAP",
355
            "e" => "MAP",
356
		    "f" => "MAP",
356
            "f" => "MAP",
357
		    "g" => "ADVS",
357
            "g" => "ADVS",
358
		    "i" => "SOUND",
358
            "i" => "SOUND",
359
		    "j" => "SOUND",
359
            "j" => "SOUND",
360
		    "k" => "ART",
360
            "k" => "ART",
361
		    "m" => "DATA",
361
            "m" => "DATA",
362
		    "o" => "GEN",
362
            "o" => "GEN",
363
		    "p" => "GEN",
363
            "p" => "GEN",
364
		    "r" => "ART",
364
            "r" => "ART",
365
		    "t" => "GEN",
365
            "t" => "MANSCPT",
366
		);
366
            );
367
    
367
368
    my %unitypehash = (
368
    my %unitypehash = (
369
		    "a" => "BOOK",
369
            "a" => "BOOK",
370
		    "b" => "BOOK",
370
            "b" => "BOOK",
371
		    "c" => "MUSIC",
371
            "c" => "MUSIC",
372
		    "d" => "MUSIC",
372
            "d" => "MUSIC",
373
		    "e" => "MAP",
373
            "e" => "MAP",
374
		    "f" => "MAP",
374
            "f" => "MAP",
375
		    "g" => "ADVS",
375
            "g" => "ADVS",
376
		    "i" => "SOUND",
376
            "i" => "SOUND",
377
		    "j" => "SOUND",
377
            "j" => "SOUND",
378
		    "k" => "ART",
378
            "k" => "ART",
379
		    "l" => "ELEC",
379
            "l" => "ELEC",
380
		    "m" => "ADVS",
380
            "m" => "GEN",
381
		    "r" => "ART",
381
            "r" => "ART",
382
		);
382
            );
383
    
383
384
    ## The type of a MARC record is found at position 06 of the leader
384
    ## The type of a MARC record is found at position 06 of the leader
385
    my $typeofrecord = defined($leader) && length $leader >=6 ?
385
    my $typeofrecord = defined($leader) && length $leader >=6 ?
386
                       substr($leader, 6, 1): undef;
386
                       substr($leader, 6, 1): undef;
387
    my $typeofrecord2 = defined($leader) && length $leader >=6 ?
388
                       substr($leader, 7, 1): undef;
387
389
388
    ## ToDo: for books, field 008 positions 24-27 might have a few more
390
    ## ToDo: for books, field 008 positions 24-27 might have a few more
389
    ## hints
391
    ## hints
Lines 399-409 sub print_typetag { Link Here
399
    }
401
    }
400
402
401
    if (!defined $typeofrecord || !exists $typehash{$typeofrecord}) {
403
    if (!defined $typeofrecord || !exists $typehash{$typeofrecord}) {
402
	print "TY  - BOOK\r\n"; ## most reasonable default
404
        print "TY  - GEN\r\n"; ## most reasonable default
403
	warn ("no type found - assume BOOK") if $marcprint;
405
        warn ("no type found - assume GEN") if $marcprint;
404
    }
406
    } elsif ( $typeofrecord =~ "a" ) {
405
    else {
407
        if ( $typeofrecord2 =~ "a" || $typeofrecord2 =~ "i" ) {
406
	print "TY  - $typehash{$typeofrecord}\r\n";
408
            print "TY  - DATA\r\n"; ## monographic component part and updating loose-leafe as Dataset
409
        } elsif ( $typeofrecord2 =~ "b" || $typeofrecord2 =~ "s" ) {
410
            print "TY  - SER\r\n"; ## serial or serial component part
411
        } elsif ( $typeofrecord2 =~ "m" ) {
412
            print "TY  - $typehash{$typeofrecord}\r\n"; ## book
413
        } elsif ( $typeofrecord2 =~ "c" || $typeofrecord2 =~ "d" ) {
414
                print "TY  - GEN\r\n"; ## collections, part of collections or made-up collections
415
        }
416
    } else {
417
        print "TY  - $typehash{$typeofrecord}\r\n";
407
    }
418
    }
408
419
409
    ## use $typeofrecord as the return value, just in case
420
    ## use $typeofrecord as the return value, just in case
410
- 

Return to bug 16245