++ed by:
SARTAK NGLENN

2 PAUSE users

Ben Bullock
and 1 contributors

romaji_styles

my @styles = romaji_styles (); # Returns a true value romaji_styles ("hepburn"); # Returns the undefined value romaji_styles ("frogs");

Given an argument, return whether it is a legitimate style of romanization.

Without an argument, return a list of possible styles, as an array of hash values, with each hash element containing "abbrev" as a short name and "full_name" for the full name of the style.

romaji2kana

Convert romanized Japanese (romaji) into katakana.

is_voiced

Given a kana or romaji input, return a true value if the sound is a voiced sound like a, za, ga, etc. and the undefined value if the sound is not.

is_romaji

# Returns "undef" is_romaji ("abcdefg"); # Returns a defined value is_romaji ("atarimae");

Detect whether a string of ASCII "looks like" romanized Japanese. If the test is successful, returns the romaji in a canonical form.

hira2kata

my $katakana = kata2hira ($hiragana);

Convert hiragana into katakana. If the input is a list, it converts each element of the list.

kata2hira

my $hiragana = kata2hira ($katakana);

Convert katakana into hiragana. If the input is a list, it converts each element of the list.

is_kana

Returns a true value if its argument is a string of kana, or an undefined value if not.

kana2katakana

Convert either katakana or hiragana to katakana.

NAME

Lingua::JA::Moji - Handle many kinds of Japanese characters

SYNOPSIS

Convert various types of characters into one another.

    use Lingua::JA::Moji;

EXPORT

FUNCTIONS

kana2romaji

    my $romaji = kana2romaji ("うれしいこども");

    # $romaji = "uresiikodomo"

Convert kana to a romanized form.

An optional second argument, a hash reference, controls the style of conversion.

    my $romaji = kana2romaji ("しんぶん", {style => "hepburn"});

    # $romaji = "shimbun"

Possible options are

style

The style of romanization. Can be "hepburn" or "passport".

use_m

If this is "true", then the first "n" in "shinbun" (しんぶん) will be converted into "m" rather than "n".

ve_type

This controls how long vowels are written. The default is to use circumflexes to represent long vowels. If you set "ve_type" => "macron", then it uses macrons. If you set "ve_type" => "passport", then it uses "oh" to write long "o" vowels.

romaji2hiragana

Convert romanized Japanese into hiragana. See romaji2kana for options.

romaji2kana

   my $kana = romaji2kana ($romaji);

Convert romanized Japanese to kana. Highly liberal.

   my $kana = romaji2kana ($romaji, {wapuro => 1});

Put wapuro => 1 to convert long vowels into the equivalent kana rather than chouon.

hira2kata

Convert hiragana to fullwidth katakana.

kata2hira

Convert fullwidth katakana to hiragana.

kana2hw

Convert hiragana, katakana, and fullwidth Japanese punctuation to halfwidth katakana and halfwidth punctuation.

hw2katakana

Convert halfwidth katakana and Japanese punctuation to fullwidth katakana and punctuation.

kana2braille

Convert Japanese kana into Japanese braille.

InHankakuKatakana

This is a character class for use with \p which can validate halfwidth katakana.

wide2ascii

Convert the "wide ASCII" used in Japan (fullwidth ASCII, 全角英数字) into usual ASCII symbols (半角英数字).

ascii2wide

Convert usual ASCII symbols (半角英数字) into the "wide ASCII" used in Japan (fullwidth ASCII, 全角英数字).

InWideAscii

This is a character class for use with \p which matches a "wide ascii" (全角英数字).

kana2morse

Convert Japanese kana into Morse code

AUTHOR

Ben Bullock, <bkb\@cpan.org>

BUGS

Please send bug reports to me by email.

STATUS

This module is alpha and the external interface is liable to change drastically in the future. If you have a request, please speak up.

SEE ALSO

Japanese kana/romanization

Data::Validate::Japanese

This is where I got several of the ideas for this module from. It contains validators for kanji and kana.

Lingua::JA::Kana

This is where I got several of the ideas for this module from. It contains convertors for hiragana, katakana (fullwidth only), and romaji. The romaji conversion is less complete than this module but more compact and probably much faster, if you need high speed romanization.

Lingua::JA::Romanize::Japanese

Romanization of Japanese. The module also includes romanization of kanji via the kakasi kanji to romaji convertor, and other functions.

Lingua::JA::Romaji::Valid

Validate romanized Japanese.

Lingua::JA::Hepburn::Passport

Other

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2008-2009 Ben Bullock, all rights reserved.

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

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 886:

Unknown directive: =list

Around line 888:

'=item' outside of any '=over'