NAME

Lingua::JA::Romaji::Valid::Filter::Kana

DESCRIPTION

Lingua::JA::Romaji::Valid splits a given word into pieces, and each of them should have consonant(s) and a vowel (or an "n" without a vowel for the last piece). Thus syllabic "n" and geminate consonants would be prepended to the following piece, that means, "shinbun" would be split into "shi", "nbu" and "n", and "sapporo" would be split into "sa", "ppo", and "ro". Filtering methods in this module would cut off these prepended syllabic "n" and geminate consonants to make validation easier.

METHODS

new

creates an object.

normalize_syllabic_n_m

cuts off an "n" prepended to a kana which starts with consonants other than "b", "m", and "p", and cuts off an "m" prepended to a kana which starts with "b", "m", or "p". Traditional (and railway/passport) Hepburn use this. This may be natural for the Westerners, but this also means syllabic "n", which has one distinct kana representation, may be rendered in two ways, and thus, is thought unnatural by Japanese people.

normalize_syllabic_n

cuts off an "n" prepended to a kana, which starts with consonants, even if the consonants are "b", "m", or "p". Revised Hepburn and ISO romanizations use this.

normalize_syllabic_nn

cuts off a double "n" ("nn") prepended to a kana. This is a vulgar and unauthorized expression of syllabic "n" but this may be clearer, as we also have "n" plus a vowel kana combinations. ::Liberal supports this by default.

normalize_syllabic_m

just cuts off an "m" prepended to a kana which starts with "b", "m", or "p".

normalize_geminate_tch

cuts off one of the geminate (double) consonants of the piece, and "t" prepended to a kana which starts with "ch". Hepburns uses this.

normalize_geminate_cch

cuts off one of the geminate (double) consonants of the piece, even if the piece has "cch" combination. This also is a vulgar and unauthorized expression of geminate (double) consonants, but relatively well-known as it is simpler.

normalize_geminate

cuts off one of the geminate (double) consonants of the piece. This doesn't care "t" before "ch", as ISO rules don't have kanas which start with "ch".

prohibit_foreign_kanas

Ordinary Japanese names don't have kanas which start with "v" or "kw". With this filter, such kind of uncommon expressions are banned even if the validation rule you specified allows them.

AUTHOR

Kenichi Ishigaki, <ishigaki at cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2007 by Kenichi Ishigaki.

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