| Text-TransMetaphone documentation | Contained in the Text-TransMetaphone distribution. |
Text::TransMetaphone::ja_katakana - Transcribe Katakana words into IPA symbols.
This module is used by Text::TransMetaphone and need not be used directly.
The Text::TransMetaphone::ja_katakana module implements the TransMetaphone algorithm
for Katakana. The module provides a trans_metaphone function that accepts
an Katakana word as an argument and returns a list of keys transcribed into
IPA symbols under Katakana orthography rules. The last key of the list is
a regular expression that matching all previously returned keys.
A reverse_key function is also provided to convert an IPA symbol key into
a regular expression that would phonological sequence under Katakana orthography.
The Katakana module has limited awareness of Katakana orthography, no alternative keys are generated at this time. The module will be updated as more rules of Katakana orthography are learnt.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
None presently known.
Daniel Yacob, dyacob@cpan.org
| Text-TransMetaphone documentation | Contained in the Text-TransMetaphone distribution. |
package Text::TransMetaphone::ja_katakana; use utf8; BEGIN { use strict; use vars qw( $VERSION $LocaleRange ); $VERSION = '0.01'; $LocaleRange = qr/\p{InKatakana}/; } sub trans_metaphone { # # since I know nothing about greek orthography, # this just blindly strips vowels and transliterates # text onto IPA. we don't worry about key length for now # $_ = $_[0]; # # strip out all but first vowel: # s/^[ã¡ã¢ã£ã¤ã¥ã¦ã§ã¨ã©ãªã¼]/a/; s/[ã¡ã¢ã£ã¤ã¥ã¦ã§ã¨ã©ãªã¼]//g; s/[ããããã]/b/g; s/[ããã]/d/g; s/[ã¬ã®ã°ã²ã´]/g/g; s/[ãããã]/h/g; s/[ãã ]/Ê£/g; s/ã/f/g; s/[ã£ã¤ã¥ã¦ã§ã¨]/j/g; s/[ã«ãµãã¯ã±ã¶ã³]/k/g; s/[ããã ã¡ã¢]/m/g; s/[ã³ããããã]/n/g; s/[ããããã]/p/g; s/[ã©ãªã«ã¬ã]/r/g; s/[ãµã·ã¹ã»ã½]/s/g; s/[ãã¿ãã]/t/g; s/[ã·ã¸ã´ã¹ãº]/v/g; s/[ã®ã¯ã°ã±ã²]/w/g; s/[ã¶ã¸ãºã¼ã¾]/z/g; ($_, $_); # no regex key at this time } sub reverse_key { $_ = $_[0]; s/a/[ã¡ã¢ã£ã¤ã¥ã¦ã§ã¨ã©ãªã¼]/; s/b/[ããããã]/g; s/d/[ããã]/g; s/g/[ã¬ã®ã°ã²ã´]/g; s/h/[ãããã]/g; s/Ê£/[ãã ]/g; s/f/ã/g; s/j/[ã£ã¤ã¥ã¦ã§ã¨]/g; s/k/[ã«ãµãã¯ã±ã¶ã³]/g; s/m/[ããã ã¡ã¢]/g; s/n/[ã³ããããã]/g; s/p/[ããããã]/g; s/r/[ã©ãªã«ã¬ã]/g; s/s/[ãµã·ã¹ã»ã½]/g; s/t/[ãã¿ãã]/g; s/v/[ã·ã¸ã´ã¹ãº]/g; s/w/[ã®ã¯ã°ã±ã²]/g; s/z/[ã¶ã¸ãºã¼ã¾]/g; $_; } ######################################################### # Do not change this, Do not put anything below this. # File must return "true" value at termination 1; ########################################################## __END__