The Perl Toolchain Summit 2025 Needs You: You can help ๐Ÿ™ Learn more

NAME

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

SYNOPSIS

my $kijitora = Acme::Nyaa->new;
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.

Nyaa is ใƒ‹ใƒฃใƒผ, Cats living in Japan meows nyaa.

CLASS METHODS

new( [%argv] )

new() is a constructor of Acme::Nyaa

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

INSTANCE METHODS

cat( \$text )

cat() is a converter that appends string ใƒ‹ใƒฃใƒผ at the end of each sentence.

my $kijitora = Acme::Nyaa->new;
my $nekotext = '็ŒซใŒใ‹ใ‚ใ„ใ„ใ€‚';
print $kijitora->cat( \$nekotext );
# ็ŒซใŒใ‹ใ‚ใ„ใ„ใƒ‹ใƒฃใƒผใ€‚

neko( \$text )

neko() is a converter that replace a noun with ใƒใ‚ณ.

my $kijitora = Acme::Nyaa->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->new;
my $filehandle = IO::File->new( 't/a-part-of-i-am-a-cat.ja.txt', 'r' );
my @nekobuffer = <$filehandle>;
print $nekoobject->straycat( \@nekobuffer );
# ๅพ่ผฉใฏ็Œซใงใ‚ใ‚‹ใƒ‹ใƒฃใ‚“ใ€‚ๅๅ‰ใฏใพใ ็„กใ„ใƒ‹ใƒฃใƒผใ€‚
# ใฉใ“ใง็”Ÿใพใ‚ŒใŸใ‹้ “ใจ่ฆ‹็•ถใŒใคใ‹ใฌใƒ‹ใƒฃใƒผใƒผ! ไฝ•ใฆใ‚‚ๆš—่–„ใ„ใ˜ใ‚ใ˜ใ‚ใ—ใŸๆ‰€ใงใƒ‹ใƒฃใƒผใƒ‹ใƒฃใƒผๆณฃใ„ใฆ
# ๅฑ…ใŸไบ‹ไธˆใฏ่จ˜ๆ†ถใ—ใฆๅฑ…ใ‚‹ใƒ‹ใƒฃใƒผใ‚“ใ€‚ๅพ่ผฉใฏใ“ใ‚ใงๅง‹ใ‚ใฆไบบ้–“ใจใ„ใตใ‚‚ใฎใ‚’่ฆ‹ใŸใƒ‹ใƒฃใƒผใƒผใƒผใƒผ! ็„ถใ‚‚ใ‚ใจใง่žใใจ
# ใใ‚Œใฏๆ›ธ็”Ÿใจใ„ใตไบบ้–“ใงไธ€็•ช็ฐๆƒกใช็จฎๆ—ใงใ‚ใคใŸใ•ใ†ใ ใƒ‹ใƒฃใ‚“ใ€‚ๆญคๆ›ธ็”Ÿใจใ„ใตใฎใฏๆ™‚ใ€…ๆˆ‘ใ€…ใ‚’ๆ•
# ใธใฆ็…ฎใฆ้ฃŸใตใจใ„ใต่ฉฑใงใ‚ใ‚‹ใƒ‹ใƒฃใƒผ!

SAMPLE APPLICATION

nyaaproxy

nyaaproxy is a sample application based on Plack using Acme::Nyaa. Start nyaaproxy by plackup command like the following and open URL such as http://127.0.0.1:2222/http://ja.wikipedia.org/wiki/ใƒใ‚ณ.

$ plackup -o 127.0.0.1 -p 2222 -a eg/nyaaproxy.psgi

REPOSITORY

https://github.com/azumakuniyuki/p5-Acme-Nyaa

INSTALL FROM REPOSITORY

% sudo cpanm Module::Install
% cd /usr/local/src
% cd ./p5-Acme-Nyaa
% perl Makefile.PL && make && make test && sudo make install

AUTHOR

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

SEE ALSO

Acme::Nyaa::Ja - Japanese module for Acme::Nyaa

LICENSE

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