DESCRIPTION

Lingua::Translit can be used to convert text from one writing system to another, based on national or international transliteration tables. Where possible a reverse transliteration is supported.

The term transliteration describes the conversion of text from one writing system or alphabet to another one. The conversion is ideally unique, mapping one character to exactly one character, so the original spelling can be reconstructed. Practically this is not always the case and one single letter of the original alpabet can be transcribed as two, three or even more letters.

Furthermore there is more than one transliteration scheme for one writing system. Therefore it is an important and necessary information, which scheme will be or has been used to transliterate a text, to work integrative and be able to reconstruct the original data.

Reconstruction is a problem though for non-unique transliterations, if no language specific knowledge is available as the resulting clusters of letters may be ambigous. For example, the Greek character "PSI" maps to "ps", but "ps" could also result from the sequence "PI", "SIGMA" since "PI" maps to "p" and "SIGMA" maps to s. If a transliteration table leads to ambigous conversions, the provided table cannot be used reverse.

Otherwise the table can be used in both directions, if appreciated. So if ISO 9 is originally created to convert Cyrillic letters to the Latin alphabet, the reverse transliteration will transform Latin letters to Cyrillic.

METHODS

new("name of table")

translit("character oriented string")

Transliterates the given text according to the object's transliteration table. Returns the transliterated text.

translit_reverse("character oriented string")

Transliterates the given text according to the object's transliteration table, but uses it the other way round. For example table ISO 9 is a transliteration scheme for the converion of Cyrillic letters to the Latin alphabet. So if used reverse, Latin letters will be mapped to Cyrillic ones.

A template of a transliteration table is provided as well (xml/template.xml) so you can easily start developing.

RESTRICTIONS

Lingua::Translit is suited to handle Unicode and utilizes comparisons and regular expressions that rely on code points. Therefore, any input is supposed to be character oriented (use utf8;, ...) instead of byte oriented.

However, if your data is byte oriented, be sure to pass it UTF-8 encoded to translit() and/or translit_reverse() - it will be converted internally.