|
NAMELingua::JA::Fold - to fold a Japanese text.SYNOPSISuse utf8; use Lingua::JA::Fold qw(fold tab2space kana_half2full); my $text = 'アイウエオ æ¼¢å—'; # replace a [TAB] with four [SPACE]s. $text = tab2space('text' => $text, 'space' => 4); # convert a half-width 'Kana' character to a full-width one. $text = kana_half2full($text); # fold a text under full-width two characters par a line. $text = fold('text' => $text, 'length' => 2); # output the result utf8::encode($text); print $text; DESCRIPTIONThis module is used to fold a Japanese text and so on.The Japanese (the Chinese and the Korean would be the same) text has traditionally unique manner in representing. Basically those characters are used to be represented in two kind of size which is 'full-width' or 'half-width'. Width and Height of full-width characters are the same size (regular square). At the point, it is different from the alphabet characters which have normally variable (slim) width in representing. Roughly say, we call width of alphabet characters and Arabic numbers as a half, and do the width of other characters as a full. In a Japanese text which is mixed with alphabet and Arabic numbers, a character has a width, it would be full or half. For such reasons, to fold a Japanese text is rather complicate thing. FUNCTIONS
SEE ALSO
NOTEThis module runs under Unicode/UTF-8 environment (hence Perl5.8 or later is required), you should input text as UTF-8 flaged string. Specify the "use utf8;" pragma in your source code and use utf8::decode() method to UTF-8 flag on.AUTHORMasanori HATA <http://www.mihr.net/> (Saitama, JAPAN)COPYRIGHTCopyright ©2003-2008 Masanori HATA. All rights reserved.This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. POD ERRORSHey! The above document had some coding errors, which are explained below:
Visit the GSP FreeBSD Man Page Interface. |