README
1NAME
2 Lingua::JA::Romanize::Japanese - Romanization of Japanese language
3
4SYNOPSIS
5 use Lingua::JA::Romanize::Japanese;
6
7 my $conv = Lingua::JA::Romanize::Japanese->new();
8 my $roman = $conv->char( $kanji );
9 printf( "<ruby><rb>%s</rb><rt>%s</rt></ruby>", $kanji, $roman );
10
11 my @array = $conv->string( $string );
12 foreach my $pair ( @array ) {
13 my( $raw, $ruby ) = @$pair;
14 if ( defined $ruby ) {
15 printf( "<ruby><rb>%s</rb><rt>%s</rt></ruby>", $raw, $ruby );
16 } else {
17 print $raw;
18 }
19 }
20
21DESCRIPTION
22 Japanese language is written with a mix of Kanji and Kana characters.
23 Most of Kanji characters used in Japan were imported from China. Two
24 types of Kana characters, called Katakana and Hiragana, were created in
25 Japan. Kana characters are general terms for the syllabic Japanese
26 scripts.
27
28METHODS
29 $conv = Lingua::JA::Romanize::Japanese->new();
30 This constructer methods returns a new object with its dictionary
31 cached.
32
33 $roman = $conv->char( $kanji );
34 This method returns romanized letters from a Japanese character. It
35 returns undef when $Kana is not a valid Japanese character. The
36 argument's encoding must be UTF-8. Both of Kanji and Kana characters are
37 allowed.
38
39 $roman = $conv->chars( $string );
40 This method returns romanized letters from multiple Japanese characters.
41
42 @array = $conv->string( $string );
43 This method returns a array of referenced arrays which are pairs of
44 Japanese chacater(s) and its romanized letters.
45
46 $array[0] # first Japanese character(s)'s pair (array)
47 $array[1][0] # secound Japanese character(s) itself
48 $array[1][1] # its romanized letters
49
50DICTIONARY
51 This module's Japanese to roman mapping table is based on the dictionary
52 of SKK which is a Japanese input method on Emacs. It was designed by Dr.
53 Masahiko Sato and created in 1987. SKK is an abbreviation of 'Simple
54 Kana to Kanji conversion program'.
55
56UTF-8 FLAG
57 This treats utf8 flag transparently.
58
59MODULE DEPENDENCIES
60 DB_File module is required.
61
62SEE ALSO
63 Lingua::ZH::Romanize::Pinyin for romanization of Standard Chinese
64
65 Lingua::KO::Romanize::Hangul for romanization of Korean
66
67 http://www.kawa.net/works/perl/romanize/romanize-e.html
68
69 http://linuga-romanize.googlecode.com/svn/trunk/Lingua-JA-Romanize-Japan
70 ese/
71
72 http://openlab.jp/skk/
73
74AUTHOR
75 Yusuke Kawasaki http://www.kawa.net/
76
77COPYRIGHT
78 Copyright (c) 2006-2008 Yusuke Kawasaki. All rights reserved.
79
80LICENSE
81 This dictionary is free software; you can redistribute it and/or modify
82 it under the terms of the GNU General Public License as published by the
83 Free Software Foundation; either versions 2, or (at your option) any
84 later version.
85
86