| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package MARC::Detrans::Name; |
|
2
|
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
1740
|
use strict; |
|
|
8
|
|
|
|
|
17
|
|
|
|
8
|
|
|
|
|
337
|
|
|
4
|
8
|
|
|
8
|
|
42
|
use warnings; |
|
|
8
|
|
|
|
|
13
|
|
|
|
8
|
|
|
|
|
366
|
|
|
5
|
8
|
|
|
8
|
|
44
|
use base qw( Class::Accessor ); |
|
|
8
|
|
|
|
|
12
|
|
|
|
8
|
|
|
|
|
2555
|
|
|
6
|
8
|
|
|
8
|
|
2561
|
use Carp qw( croak ); |
|
|
8
|
|
|
|
|
14
|
|
|
|
8
|
|
|
|
|
1664
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
MARC::Detrans::Name - A single name mapping |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use MARC::Detrans::Name; |
|
15
|
|
|
|
|
|
|
my $name = MARC::Detrans::Name->new( |
|
16
|
|
|
|
|
|
|
from => '$aNicholas $bI, $cEmperor of Russia, $d1796-1855', |
|
17
|
|
|
|
|
|
|
to => '$a^[(NnIKOLAJ^[s, $bI, $c^[(NiMPERATOR^[s ^[(NwSEROSSIJSKIJ^[s, $d1796-1855' |
|
18
|
|
|
|
|
|
|
); |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
MARC::Detrans::Rule represents a single non-standard detransliteration mapping |
|
23
|
|
|
|
|
|
|
for a MARC field. For example personal names often have non-standard |
|
24
|
|
|
|
|
|
|
transliterations, so to get them back to the original script a non-rules based |
|
25
|
|
|
|
|
|
|
detransliteration has to occur. |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
MARC::Detrans::Name and MARC::Detrans::Names aid in this process by allowing you |
|
28
|
|
|
|
|
|
|
to create a single mapping of one field to another, and then adding them to a |
|
29
|
|
|
|
|
|
|
rule set. |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 METHODS |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 new() |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
The constructor which you must pass the from and to parameters, which |
|
36
|
|
|
|
|
|
|
define what name will be transformed. |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
|
41
|
5
|
|
|
5
|
1
|
587
|
my ($class,%args) = @_; |
|
42
|
5
|
50
|
|
|
|
25
|
croak( "must supply from parameter" ) if ! exists $args{from}; |
|
43
|
5
|
50
|
|
|
|
25
|
croak( "must supply to parameter" ) if ! exists $args{to}; |
|
44
|
|
|
|
|
|
|
## convert ^ESC to 0x1B since XML can't contain this character |
|
45
|
5
|
|
|
|
|
43
|
$args{to} =~ s/\^ESC/\x1B/g; |
|
46
|
5
|
|
|
|
|
68
|
return $class->SUPER::new( \%args ); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 from() |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 to() |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
MARC::Detrans::Name->mk_accessors( qw( |
|
56
|
|
|
|
|
|
|
from |
|
57
|
|
|
|
|
|
|
to |
|
58
|
|
|
|
|
|
|
) ); |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |