MARC::Detrans::Name - A single name mapping


MARC-Detrans documentation Contained in the MARC-Detrans distribution.

Index


Code Index:

NAME

Top

MARC::Detrans::Name - A single name mapping

SYNOPSIS

Top

    use MARC::Detrans::Name;
    my $name = MARC::Detrans::Name->new(
        from => '$aNicholas $bI, $cEmperor of Russia, $d1796-1855',
        to   => '$a^[(NnIKOLAJ^[s, $bI, $c^[(NiMPERATOR^[s ^[(NwSEROSSIJSKIJ^[s, $d1796-1855' 
    );

DESCRIPTION

Top

MARC::Detrans::Rule represents a single non-standard detransliteration mapping for a MARC field. For example personal names often have non-standard transliterations, so to get them back to the original script a non-rules based detransliteration has to occur.

MARC::Detrans::Name and MARC::Detrans::Names aid in this process by allowing you to create a single mapping of one field to another, and then adding them to a rule set.

METHODS

Top

new()

The constructor which you must pass the from and to parameters, which define what name will be transformed.

from()

to()


MARC-Detrans documentation Contained in the MARC-Detrans distribution.
package MARC::Detrans::Name;

use strict;
use warnings;
use base qw( Class::Accessor );
use Carp qw( croak );

sub new {
    my ($class,%args) = @_;
    croak( "must supply from parameter" ) if ! exists $args{from};
    croak( "must supply to parameter" ) if ! exists $args{to};
    ## convert ^ESC to 0x1B since XML can't contain this character
    $args{to} =~ s/\^ESC/\x1B/g;
    return $class->SUPER::new( \%args );
}

MARC::Detrans::Name->mk_accessors( qw(
    from
    to
) );

1;