NAME

Acme::Nyaa - Convert texts like which a cat is talking in Japanese

SYNOPSIS

use Acme::Nyaa::Ja;
my $kijitora = Acme::Nyaa::Ja->new();

# the following code is equivalent to the above.

use Acme::Nyaa;
my $kijitora = Acme::Nyaa->new( 'language' => 'ja' );


print $kijitora->cat( \'猫がかわいい。' );	# => 猫がかわいいニャー。
print $kijitora->neko( \'神と和解せよ' );	# => ネコと和解せよ

DESCRIPTION

Acme::Nyaa is a converter which translate Japanese texts to texts like which a cat talking. Language modules are available only Japanese (Acme::Nyaa::Ja) for now.

CLASS METHODS

new()

new() is a constructor of Acme::Nyaa::Ja

my $kijitora = Acme::Nyaa::Ja->new();
my $sabatora = Acme::Nyaa->new( 'language' => 'ja' );

INSTANCE METHODS

cat( \$text )

cat() is a converter that appends string ニャー at the end of each sentence.

my $kijitora = Acme::Nyaa::Ja->new;
my $nekotext = '猫がかわいい。';
print $kijitora->cat( \$nekotext );
# 猫がかわいいニャーー!!

neko( \$text )

neko() is a converter that replace a noun with ネコ.

my $kijitora = Acme::Nyaa::Ja->new;
my $nekotext = '人の道も行いも神は見ている';
print $kijitora->neko( \$nekotext );
# 人の道も行いもネコは見ている

nyaa( [\$text] )

nyaa() returns string: ニャー.

my $kijitora = Acme::Nyaa->new;
print $kijitora->nyaa();	# ニャー
print $kijitora->nyaa('京都');	# 京都にゃー

straycat( \@array-ref | \$scalar-ref [,1] )

straycat() converts multi-lined sentences. If 2nd argument is given then this method also replace each noun with ネコ.

my $nekoobject = Acme::Nyaa::Ja->new;
my $filehandle = IO::File->new( 't/a-part-of-i-am-a-cat.ja.txt', 'r' );
my @nekobuffer = <$filehandle>;
print $nekoobject->straycat( \@nekobuffer );

# 吾輩は猫であるニャ。名前はまだ無いニャーー! 
# どこで生まれたか頓と見當がつかぬニャーん。何ても暗薄いじめじめした所でニャーニャー泣いて
# 居た事丈は記憶して居るニャーん。吾輩はこゝで始めて人間といふものを見たニャーん。然もあとで聞くと
# それは書生といふ人間で一番獰惡な種族であつたさうだニャーーー!! 此書生といふのは時々我々を捕
# へて煮て食ふといふ話であるニャ〜。

AUTHOR

azumakuniyuki <perl.org [at] azumakuniyuki.org>

SEE ALSO

Acme::Nyaa

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.