View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Ed Summers > MARC-Detrans > MARC::Detrans



Annotate this POD


New  1
Open  0
View/Report Bugs
Module Version: 1.41   Source  


MARC::Detrans - De-transliterate text and MARC records


    use MARC::Batch;
    use MARC::Detrans;

    my $batch = MARC::Batch->new( 'marc.dat' );
    my $detrans = MARC::Detrans->new( 'config.xml' );

    while ( my $record = $batch->next() ) {
        my $newRecord = $detrans->convert( $record );


MARC::Detrans is an eclectic addition to the already eclectic MARC::Record distribution for de-transliterating MARC::Records. What is detransliteration you ask? Well it's the opposite of transliteration, which according to the Merriam-Webster:

    to represent or spell in the characters of another alphabet

Traditionally when librarians catalog an item that has a title in a non-Roman script they will follow transliteration rules for converting the title into the Roman alphabet, so that the bibliographic record could be filed into the card catalog or database index appropriately. These Romanization Rules are published by the Library of Congress

Now that computer screens can display Unicode fairly well it is now desirable to display the original script for library users who are more familiar with the original script. MARC::Detrans provides a framework for detransliterating MARC records so that the orginal script is available MARC-8 encoded in 880 fields. Very esoteric right?


MARC::Detrans behavior is controlled by an XML configuration file. An example of this configuration file can be found in the examples directory of the MARC::Detrans distribution. The configuration determines the detransliteration rules that will be used to add 880 fields to existing records. It is hoped that people will contribute their configurations for various languages to the MARC::Detrans project so that they can be distributed with this package. For more information about the configuration file see MARC::Detrans::Config.

In addition a sample driver program which uses MARC::Detrans has also been included in the examples directory. This script is meant as a jumping off point showing how to use the MARC::Detrans framework.



The constructor which you should pass the path to your configuration file.

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


If you want to supply your own MARC::Detran::Config object instead of an XML file configuration as in new() you can use newFromConfig(). It's unlikely that you'll ever need to use this method.


Pass a MARC::Record into convert() and you will be returned a the same object with portions of it modified according to your configuration file.

IMPORTANT: if the record was not modified or an error was encountered you will be returned undef instead of the MARC::Record object. You will want to use the errors() method for diagnosing what happened.


Will return the latest errors encountered during a call to convert(). Can be useful for determining why a call to convert() returned undef. A side effect of calling errors() is that the errors storage is reset.


Returns the total amount of 880 fields added to records so far by this MARC::Detrans object.


Returns a hash of stats on the field_subfield combinations that have been detransliterated by a MARC::Detrans object.


Returns a hash of stats on the field_subfield combinations that have been copied by a MARC::Detrans object.


MARC::Detrans was developed as part of a project funded by the Queens Borough Public Library in New York City under the direction of Jane Jacobs. It is their generosity that allowed this package to be released on CPAN.

syntax highlighting: