Lingua::JA::Regular - Regularize of the Japanese character.
my $string = Lingua::JA::Regular->new($string)->regular; my $regular = Lingua::JA::Regular->new($string); $regular->strip->linefeed->h_ascii->z_kana; if ($ENV{HTTP_USER_AGENT} =~ /Windows/) { $regular->win; } elsif ($ENV{HTTP_USER_AGENT} =~ /Mac/) { $regular->mac; } print $regular->geta->to_s;
Regularize of the Japanese character
Converts platform specific charactes to standard characters.
Converts multi byte(Japanese) alphanumeric and symbolcharacters to single byte characters.
my $str = Convert::Character->new($str);
Create object.
$str->to_s;
It changes into a character sequence from an object.
$str->linefeed; $str->linefeed("\r"); $str->linefeed("\r\n"); $str->linefeed("<br>");
A new-line character(\r\n, \n, \r) is replaced by the argument. If an argument becomes undef, it will replace by "\n".
$str->strip;
The blank character of order is deleted.
$str->uc;
uppercase.
$str->lc;
lowercase.
alphabet, number, and sign are changed into ZENKAKU.
alphabet, number, and sign are changed into HANKAKU.
h2z of Jcode is performed.
z2h of Jcode is performed.
HANKAKU space is changed into a ZENKAKU space.
ZENKAKU space is changed into a HANKAKU space.
The blank and ZENKAKU space character of order is deleted.
It changes into a HIRAGANA.
It changes into a KATAKANA.
The model dependence character of KANJI is changed into an alternative character.
The model dependence character of Windows is changed into an alternative character.
The model dependence character of Macintosh is changed into an alternative character.
The model dependence character is changed into an GETA.
It is the same as the result which performed strip, (win|mac), linefeed, z_kana, h_ascii, kanji, ,geta, and the to_s method.
KIMURA, takefumi <takefumi@takefumi.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Jcode, Lingua::JA::Regular::Table, Lingua::JA::Regular::Table::Kanji, Lingua::JA::Regular::Table::Macintosh, Lingua::JA::Regular::Table::Windows
http://code.mfac.jp/trac/browser/CPAN/takefumi/Lingua-JA-Regular/
To install Lingua::JA::Regular, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::JA::Regular
CPAN shell
perl -MCPAN -e shell install Lingua::JA::Regular
For more information on module installation, please visit the detailed CPAN module installation guide.