| Text-TransMetaphone documentation | Contained in the Text-TransMetaphone distribution. |
Text::TransMetaphone::gu - Transcribe Gujarti words into IPA symbols.
This module is used by Text::TransMetaphone and need not be used directly.
The Text::TransMetaphone::gu module implements the TransMetaphone algorithm
for Gujarti. The module provides a trans_metaphone function that accepts
an Gujarti word as an argument and returns a list of keys transcribed into
IPA symbols under Gujarti 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 Gujarti orthography.
The Gujarti module is the most developed in the TransMetaphone package. The Gujarti module applies basic phonetic mappings to generate keys. No alternative keys are generated at this time. The module will be updated as more rules of Gujarti 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::gu; use utf8; BEGIN { use strict; use vars qw( $VERSION $LocaleRange ); $VERSION = '0.01'; $LocaleRange = qr/\p{InGujarti}/; } sub trans_metaphone { # # since I know nothing about gujarti 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; s/[àªàª]/g/g; s/હ/h/g; s/[àªàª]/ʤ/g; s/ય/j/g; s/àª/k/g; s/àª/k'/g; s/[લળ]/l/g; s/મ/m/g; s/ન/n/g; s/[ણàª]/ɲ/g; s/àª/Å/g; s/પ/p/g; s/ફ/p'/g; s/ર/r/g; s/સ/s/g; s/[ષશ]/Ê/g; s/[àªàª¤]/t/g; s/[ઠથ]/t'/g; s/àª/ʧ/g; s/àª/ʧ'/g; s/વ/w/g; ($_, $_); # no regex key at this time } sub reverse_key { $_ = $_[0]; s/a/[ઠàªàªàªàªàªàªàªàªàªàªàªàªàª¾àª¿à«à«à«à«à«à« à«à«à«à«à«à« ]/; s/k'/àª/g; s/p'/ફ/g; s/t'/[ઠથ]/g; s/ʧ'/àª/g; s/b/[બàª]/g; s/d/[ડદ]/g; s/É/[ઢધ]/g; s/g/[àªàª]/g; s/h/હ/g; s/ʤ/[àªàª]/g; s/j/ય/g; s/k/àª/g; s/l/[લળ]/g; s/m/મ/g; s/n/ન/g; s/ɲ/[ણàª]/g; s/Å/àª/g; s/p/પ/g; s/r/ર/g; s/s/સ/g; s/Ê/[ષશ]/g; s/t/[àªàª¤]/g; s/ʧ/àª/g; s/w/વ/g; $_; } ######################################################### # Do not change this, Do not put anything below this. # File must return "true" value at termination 1; ########################################################## __END__