The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Lingua::JA::Romanize::Japanese - Romanization of Japanese language


    use Lingua::JA::Romanize::Japanese;

    my $conv = Lingua::JA::Romanize::Japanese->new();
    my $roman = $conv->char( $kanji );
    printf( "<ruby><rb>%s</rb><rt>%s</rt></ruby>", $kanji, $roman );

    my @array = $conv->string( $string );
    foreach my $pair ( @array ) {
        my( $raw, $ruby ) = @$pair;
        if ( defined $ruby ) {
            printf( "<ruby><rb>%s</rb><rt>%s</rt></ruby>", $raw, $ruby );
        } else {
            print $raw;


Japanese language is written with a mix of Kanji and Kana characters. Most of Kanji characters used in Japan were imported from China. Two types of Kana characters, called Katakana and Hiragana, were created in Japan. Kana characters are general terms for the syllabic Japanese scripts.


$conv = Lingua::JA::Romanize::Japanese->new();

This constructer methods returns a new object with its dictionary cached.

$roman = $conv->char( $kanji );

This method returns romanized letters from a Japanese character. It returns undef when $Kana is not a valid Japanese character. The argument's encoding must be UTF-8. Both of Kanji and Kana characters are allowed.

$roman = $conv->chars( $string );

This method returns romanized letters from multiple Japanese characters.

@array = $conv->string( $string );

This method returns a array of referenced arrays which are pairs of Japanese chacater(s) and its romanized letters.

    $array[0]           # first Japanese character(s)'s pair (array)
    $array[1][0]        # secound Japanese character(s) itself
    $array[1][1]        # its romanized letters


This module's Japanese to roman mapping table is based on the dictionary of SKK which is a Japanese input method on Emacs. It was designed by Dr. Masahiko Sato and created in 1987. SKK is an abbreviation of 'Simple Kana to Kanji conversion program'.


This treats utf8 flag transparently.


DB_File module is required.


Lingua::ZH::Romanize::Pinyin for romanization of Standard Chinese

Lingua::KO::Romanize::Hangul for romanization of Korean


Yusuke Kawasaki


Copyright (c) 2006-2008 Yusuke Kawasaki. All rights reserved.


This dictionary is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either versions 2, or (at your option) any later version.