NAME

Template::Plugin::Translit::RU - Filter converting cyrillic text into transliterated one and back.

SYNOPSIS

Use as filters.

[% USE Translit::RU 'translit' 'detranslit' %]
[% FILTER translit( 'koi' ) %]
...
This text would stay unchanged because it is not cyrillic.
...
[% END %]

Use as object. First argument - text for conversion. Second optional argument - charset ('koi' is default).

[% USE plTranslit = Translit::RU %]
[% plTranslit.translit( 'without cyrillic text is useless' ) %]
[% plTranslit.detranslit( 'kirilitca', 'win' ) %]

DESCRIPTION

Template::Plugin::Translit::RU is Template Toolkit filter which allows to convert cyrillic text into transliterated latin text. Currently two most popular charsets are supported - koi8-r and windows-1251. Also back conversion supported.

SUPPORTED CHARSETS

Currently Template::Plugin::Translit::RU supports 2 main cyrillic charsets koi8-r and windows-1251.

Charset arguments could take such values:

  • 'koi', 'koi8-r', 'koi8r', 'koi8' - for koi8-r charset.

  • 'win', 'windows-1251', 'cp1251' - for windows-1251 charset.

KNOWN PROBLEMS

In some cases there is no exact correspondence between source cyrillic word and result of cyrillic->translit->cyrillic conversion (CTC-conversion). Although one of the aims of this module is to find such correspondence, this is difficult without making transliterated text bad understandable. Currently 2 main problems are known:

  • Case loss while conversion of hard and soft signs (UPPER source after CTC become lower). This could take place if you make CTC-conversion with UPPER case words. Fortunately there are no words which starts with signs.

  • Wrong CTC-conversion in rare cases where cyrillic letters 'sh' and 'ch' meets one after another. In this case they are converted in cyrillic letter 'shch'. This is rare case (I met it only twice after scaning dictionary with 130000 words) and very rare words.

IMPORTANT NOTE

This is alpha release of module. Charset tables and other stuff could be changed in future versions. Use this module on your own risk.

SEE ALSO

Template

AUTHOR

Igor Lobanov, <igor.lobanov@gmail.com>

COPYRIGHT

Copyright (C) 2004 Igor Lobanov. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.