The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lingua::Deva::Maps - Default maps setup for Lingua::Deva

SYNOPSIS

    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 'गणेशः'

DESCRIPTION

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.

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.

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 (Aa) or not (A = a) in the scheme.

The default mappings of a Lingua::Deva object can be completely customized through the optional constructor arguments

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.

Aside from all this, Lingua::Deva::Maps also defines the global variables

$Inherent

the inherent vowel a,

$Virama

virāma ( ्), and

$Avagraha

avagraha (ऽ),

which are unlikely to need configurability.