Text::TransMetaphone::ja_hiragana - Transcribe Hiragana words into IPA symbols.


Text-TransMetaphone documentation Contained in the Text-TransMetaphone distribution.

Index


Code Index:

NAME

Top

Text::TransMetaphone::ja_hiragana - Transcribe Hiragana words into IPA symbols.

SYNOPSIS

Top

This module is used by Text::TransMetaphone and need not be used directly.

DESCRIPTION

Top

The Text::TransMetaphone::ja_hiragana module implements the TransMetaphone algorithm for Hiragana. The module provides a trans_metaphone function that accepts an Hiragana word as an argument and returns a list of keys transcribed into IPA symbols under Hiragana 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 Hiragana orthography.

STATUS

Top

The Hiragana module has limited awareness of Hiragana orthography, no alternative keys are generated at this time. The module will be updated as more rules of Hiragana orthography are learnt.

COPYRIGHT

Top

BUGS

Top

None presently known.

AUTHOR

Top

Daniel Yacob, dyacob@cpan.org

SEE ALSO

Top

Text::TransMetaphone


Text-TransMetaphone documentation Contained in the Text-TransMetaphone distribution.

package Text::TransMetaphone::ja_hiragana;

use utf8;
BEGIN
{
	use strict;
	use vars qw( $VERSION $LocaleRange );

	$VERSION = '0.01';

	$LocaleRange = qr/\p{InHiragana}/;

}


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/[ちつ]/ʦ/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/ʦ/[ちつ]/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__