Lingua::Deva::Maps - Default maps setup for Lingua::Deva
use Lingua::Deva::Maps::IAST; # or use Lingua::Deva::Maps::ISO15919; # or use Lingua::Deva::Maps::HK; # or use Lingua::Deva::Maps::ITRANS; my $d = Lingua::Deva->new(map => 'HK'); say $d->to_deva('gaNezaH'); # prints 'गणेशः'
This module defines the default transliteration mappings for Lingua::Deva and is intended for internal use.
It does, however, provide the namespace for the ready-made transliteration schemes,
Lingua::Deva::Maps::IAST
International Alphabet of Sanskrit Transliteration (kṛṣṇa),
Lingua::Deva::Maps::ISO15919
Simplified ISO 15919 (kr̥ṣṇa),
Lingua::Deva::Maps::HK
Harvard-Kyoto (kRSNa), and
Lingua::Deva::Maps::ITRANS
ITRANS (kRRiShNa).
Users can also furnish their own transliteration schemes, but these must follow the layout of the existing schemes which is described in the following.
Every transliteration scheme provides four hashes, %Consonants, %Vowels, %Diacritics (diacritic vowel signs), and %Finals (anusvāra, candrabindu, visarga). The Lingua::Deva module relies on this subdivision for its parsing and aksarization process.
%Consonants
%Vowels
%Diacritics
%Finals
Inside these hashes the keys are Latin script tokens and the values are the corresponding Devanagari characters:
"bh" => "\N{DEVANAGARI LETTER BHA}" # in %Consonants
The hash keys ("tokens") must be in canonically decomposed form (NFD). For example a key "ç" ("c" with cedilla) needs to be entered as "c\x{0327}", ie. a "c" with combining cedilla. If the transliteration scheme is case-insensitive, the keys must be lowercase.
"c\x{0327}"
In addition to the required four hash maps, a boolean variable $CASE may be present. If it is, it specifies whether case distinctions by default do have significance (A ≠ a) or not (A = a) in the scheme.
$CASE
The default mappings of a Lingua::Deva object can be completely customized through the optional constructor arguments
C, V, D, F, Latin to Devanagari maps,
DC, DV, DD, DF, Devanagari to Latin maps, and
casesensitive, case-sensitivity.
The first eight of these serve to override the default transliteration mappings (or the one passed through the map option). It is easiest to start by copying and modifying one of the existing maps.
# Include the relevant module use Lingua::Deva::Maps::IAST; # Copy map, modify, then pass to the constructor my %c = %Lingua::Deva::Maps::IAST::Consonants; $c{"c\x{0327}"} = delete $c{"s\x{0301}"}; my $d = Lingua::Deva->new( C => \%c );
It is the user's responsibility to make reasonable customizations; eg. the vowels (V) and diacritics (D) maps normally need to be customized in unison.
V
D
Aside from all this, Lingua::Deva::Maps also defines the global variables
Lingua::Deva::Maps
$Inherent
the inherent vowel a,
$Virama
virāma ( ्), and
$Avagraha
avagraha (ऽ),
which are unlikely to need configurability.
To install Lingua::Deva, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::Deva
CPAN shell
perl -MCPAN -e shell install Lingua::Deva
For more information on module installation, please visit the detailed CPAN module installation guide.