Acme-Ikamusume
view release on metacpan or search on metacpan
lib/Acme/Ikamusume.pm view on Meta::CPAN
my $latest = join "",
$node->prev && $node->prev->text,
$node->text;
if ($latest =~ /(?:ã²ã½|ã¤ã¼?ã«)$/) {
return;
}
$node->text($node->text . 'ã§ã²ã½');
}
if ($node->is('åè©') and
$node->inflection_form =~ 'åºæ¬å½¢' and
$next->pos =~ /^å©è©/) {
$node->text($node->text . 'ã§ã²ã½');
}
},
# EBI: accent
sub {
my $node = shift;
my $text = $node->text;
my @ebi_accent = qw(ï¼ âª âª â« â¬ â¡);
$text =~ s{(ã¨ã|ãã³|æµ·è)}{
$1 . $ebi_accent[ int rand scalar @ebi_accent ];
}e;
$node->text($text);
},
);
sub apply_rules {
my ($self, $node) = @_;
for my $rule (@rules) {
$rule->($node);
}
}
1;
__END__
=encoding utf-8
=head1 NAME
Acme::Ikamusume - The invader comes from the bottom of the sea!
=head1 SYNOPSIS
use utf8;
use Acme::Ikamusume;
print Acme::Ikamusume->geso('ã¤ã«å¨ã§ããããªããperlã§ä¾µç¥ãã¾ãããï¼');
# => ã¤ã«å¨ã§ã²ã½ãã主ãperlã§ä¾µç¥ããªã¤ã«ï¼
=head1 DESCRIPTION
Acme::Ikamusume converts Japanese text into like Ikamusume speak.
Ikamusume, meaning "Squid-Girl", she is a cute Japanese comic/manga
character (L<http://www.ika-musume.com/>).
Try this module here: L<http://ika.koneta.org/>. enjoy!
=head1 METHODS
=over 4
=item $output = Acme::Ikamusume->geso( $input )
=back
=head1 AUTHOR
Naoki Tomita E<lt>tomita@cpan.orgE<gt>
=head1 LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
( run in 5.937 seconds using v1.01-cache-2.11-cpan-d80b1682f3f )