Ed Summers > MARC-Detrans-1.41 > MARC::Detrans::Config

Download:
MARC-Detrans-1.41.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

MARC::Detrans::Config - Stores de-transliteration configuration data

SYNOPSIS ^

    use MARC::Detrans::Config;
    my $config = MARC::Detrans::Config->new( 'file.xml' );

DESCRIPTION ^

MARC::Detrans::Config will read detransliteration rules from an XML file which you can then use to create a MARC::Detrans::Converter object to actually convert MARC records.

    <?xml version="1.0" encoding="UTF-8"?>
    <config>

        <!-- the language we are detransliterating -->
        <language name="Russian" code="rus" />

        <!-- the script that will be used -->
        <script name="Cyrillic" code="(N" />

        <!-- which fields/subfields to detransliterate or copy -->
        <detrans-fields>
            <field tag="245">
                <subfield code="a" />
                <subfield code="q" />
                <subfield code="d" copy="true" />
            </field>
            <field tag="440">
                <subfield code="a" />
            </field>
        </detrans-fields>

        <!-- a single character mapping -->
        <rule>
            <roman>b</roman>
            <marc escape="(N">B</marc>
        </rule>

        <!-- more rules ... -->

        <!-- a single authority mapping -->
        <name>
            <roman>$aNicholas $bI, $cEmperor of Russia, $d1796-1855</roman>
            <marc>$a^ESC(NnIKOLAJ^ESCs, $bI, $c^ESC(NiMPERATOR^ESCs ^ESC(NwSEROSSIJSKIJ^ESCs, $d1796-1855</marc>
        </name>

    </config>

METHODS ^

new()

The constructor, which you should pass the file path for the XML configuration. If you want to configure the MARC::Detrans::Config object manually you can not pass in a path, but you ordinarily wouldn't want to do this.

rules()

Returns a MARC::Detrans::Rules object that contains the transliteration rules being used in the configuration.

names()

Returns a MARC::Detrans::Names object that contains the authority mappings being used in the configuration.

allEscapeCodes()

Returns a list of all the MARC8 escape codes that are in use in this configuration. Useful for when you are building 006 fields that itemize the different character set codes in use.

detransFields()

Returns a list of fields that the configuration lists as desiring de-transliteration. If you need to you can pass in an array of field names you'd like to detransliterate...but normally you won't want to do this since the value come from the XML configuration.

needsDetrans()

Returns true (1) or false (undef) to indicate whether the config lists a particular field/subfield combination as needing detransliteration.

needsCopy()

Returns true (1) or false (undef) to indicate wheter the config lists a particular field/subfield combination as needing a copy.

AUTHORS ^

syntax highlighting: