Acme-AjiFry
view release on metacpan or search on metacpan
lib/Acme/AjiFry.pm view on Meta::CPAN
my $consonant;
if ( $ajifry_word =~ s/^(é£ã|ãã©ã¤|ãåºèº«|ã¢ã¸|ãã|山岡|岡æ|ã´ã¯ã»ã»ã»|ã´ã¯ï½¥ï½¥ï½¥|ã´ã¯â¦|ãã|éå±±)//
)
{
$consonant = $1;
}
unless ($consonant) {
$ajifry_word =~ s/^(.)//;
$translated_word .= $1;
next;
}
my $vowel;
if ( $ajifry_word =~ s/^(é£ãé£ã|ãããã|ãåºèº«|ããã»ã»ã»|ãã・・・|ããâ¦|ã¢ã¸ãã©ã¤)//
)
{
$vowel = $1;
}
unless ($vowel) {
$translated_word .= $consonant;
$ajifry_word =~ s/^(.)//;
$translated_word .= $1;
next;
}
my $is_dullness;
$is_dullness = $1 if $ajifry_word =~ s/^(é¶äºº)//;
my $is_p_sound;
$is_p_sound = $1 if $ajifry_word =~ s/^(社主)//;
$consonant = $self->_get_consonant_by_ajifry_word($consonant);
$vowel = $self->_get_vowel_by_ajifry_word($vowel);
my @match_characters =
$self->_find_duplicate_element_in_both_lists( ROWS->{$consonant},
COLS->{$vowel} );
if ($is_p_sound) {
$translated_word .= $match_characters[2];
}
elsif ($is_dullness) {
$translated_word .= $match_characters[1];
}
elsif ( $is_double_consonant && $consonant eq 't' ) {
$translated_word .= $match_characters[2];
}
elsif ($is_double_consonant) {
$translated_word .= $match_characters[1];
}
else {
$translated_word .= $match_characters[0];
}
}
return $translated_word;
}
1;
__END__
=encoding utf8
=head1 NAME
Acme::AjiFry - AjiFry Language (ã¢ã¸ãã©ã¤èª) Translator
=head1 VERSION
This document describes Acme::AjiFry version 0.09
=head1 SYNOPSIS
use Acme::AjiFry;
my $ajifry = Acme::AjiFry->new();
print $ajifry->to_AjiFry('ãããã¿')."\n"; # outputs => "é£ãã¢ã¸ãã©ã¤ãåºèº«é£ãé£ããåºèº«ãããã岡æãããã"
print $ajifry->to_Japanese('é£ãã¢ã¸ãã©ã¤ãåºèº«é£ãé£ããåºèº«ãããã岡æãããã')."\n"; # outputs => "ãããã¿"
=head1 DESCRIPTION
Acme::AjiFry is the AjiFry-Language translator.
This module can translate Japanese into AjiFry-Language, and vice versa.
If you would like to know about AjiFry-Language, please refer to the following web site (Japanese Web Site).
L<http://ja.uncyclopedia.info/wiki/%E3%82%A2%E3%82%B8%E3%83%95%E3%83%A9%E3%82%A4%E8%AA%9E>
=head1 METHODS
=over
=item new
new is the constructor of this module.
=item to_Japanese
This function needs a AjiFry-Language string as parameter.
It returns Japanese which was translated from AjiFry-Language.
=item to_AjiFry
This function needs a string as parameter.
It returns AjiFry-Language which was translated from Japanese.
=back
=head1 DEPENDENCIES
=over 4
=item * Encode (version 2.39 or later)
=back
=head1 BUGS AND LIMITATIONS
=for author to fill in:
( run in 2.092 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )