|
NAMEText::Kakasi - perl frontend to kakasiSYNOPSISuse Text::Kakasi; # functional $res = Text::Kakasi::getopt_argv('-JJ', '-c', '-w'); $str = Text::Kakasi::do_kakasi($japanese_text); # object-oriented $obj = Text::Kakasi->new('-JJ', '-c', '-w'); $str = $obj->get($japanese_text); DESCRIPTIONThis module provides interface to kakasi (kanji kana simple inverter). kakasi is a set of programs and libraries which does what Japanese input methods do in reverse order. You feed Japanese and kakasi converts it to phonetic representation thereof. kakasi can also be used to tokenizing Japanese text. To find more about kakasi, see <http://kakasi.namazu.org/> .Text::Kakasi now features both functional and object-oriented APIs. functional APIs are 100% compatible with ver. 1.05. But to take advantage of "Perl 5.8 Features", you should use OOP APIs instead. See Text::Kakasi::JP for the Japanese version of this document. Functional APIsNote "Text::Kakasi::" is omitted. Text::Kakasi does not export these functions by default. You can import these function as follows;use Text::Kakasi qw/getopt_argv do_kakasi/;
Object-Oriented APIsAs of 2.0, Text::Kakasi also offers OOP APIs.
Perl 5.8 FeaturesPerl 5.8 introduces Encode module which transcodes various encodings. This module takes advantage of this feature but to keep backward compatibility with version 1.x, This feature is enabled only when you use OOP interface (version 1.x only provided functional APIs).On Perl 5.8 and up, "-iencoding " and "-oencoding"are handled by Encode module so you can use encodings Kakasi does not suppport such as utf8. In other words, $result = $k->set(qw/-iutf8 -outf8 -w/)->get($utf8); Is analogous to: $euc = encode('eucjp' => $utf8); getopt_argv('-w'); $tmp = do_kakasi($euc); $result = decode('eucjp' => $tmp); When you specify "-outf8", "$k->get" will return the string with utf8 flag on. You can suppress this feature by setting $Text::Kakasi::HAS_ENCODE to 0 in which case this feature is not used. SEE ALSOkakasi(1), <http://kakasi.namazu.org/>,Encode,perlunicodeCOPYRIGHT(C) 1998, 1999, 2000 NOKUBI Takatsugu <knok@daionet.gr.jp> (C) 2003 Dan Kogai <dankogai@dan.co.jp> There is no warranty for this free software. Anyone can modify and/or redistribute this module under GNU GENERAL PUBLIC LICENSE. See COPYING file that is included in the archive for more details.
Visit the GSP FreeBSD Man Page Interface. |