Lingua::JA::Romanize::MeCab - Romanization of Japanese language with MeCab
use Lingua::JA::Romanize::MeCab;
my $conv = Lingua::JA::Romanize::MeCab->new();
my $roman = $conv->char( $kanji );
printf( "<ruby><rb>%s</rb><rt>%s</rt></ruby>", $kanji, $roman );
my @array = $conv->string( $string );
foreach my $pair ( @array ) {
my( $raw, $ruby ) = @$pair;
if ( defined $ruby ) {
printf( "<ruby><rb>%s</rb><rt>%s</rt></ruby>", $raw, $ruby );
} else {
print $raw;
}
}
This is a MeCab version of Lingua::JA::Romanize::Japanese module. This requires
MeCab.pm module which is distributed in mecab-perl-0.xx.tar.gz package.
This treats utf8 flag transparently.
Lingua::JA::Romanize::Japanese
http://mecab.sourceforge.jp/ (Japanese)
Copyright (c) 2006-2008 Yusuke Kawasaki. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
as Perl itself.