Module:tevo-translit: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 12: | Line 12: | ||
local diacritics = { | local diacritics = { | ||
[ | ['ा']='ā', | ||
[ | ['ि']='i', | ||
[ | ['ी']='ī', | ||
['ु']='u', | |||
['ू']='ū', | |||
["ॆ"]='ei', | ["ॆ"]='ei', | ||
[ | ['े']='ēi', | ||
[" | ["ॅ"]='e', | ||
[ | ['ै']='ē', | ||
[ | ['ो']='ōu', | ||
['ौ']='ō', | |||
['्']='', | |||
['॔']='́', | |||
['॓']='̀', | |||
} | } | ||
local tt = { | local tt = { | ||
-- vowels | -- vowels | ||
['अ']='a', ['आ']='ā', ['इ']='i', ['ई']='ī', ['उ']='u', ['ऊ']='ū', [' | ['अ']='a', | ||
[' | ['आ']='ā', | ||
['इ']='i', | |||
['ई']='ī', | |||
['उ']='u', | |||
['ऊ']='ū', | |||
['ऎ']="ei", | |||
['ए']='ēi', | |||
['ऍ']='e', | |||
['ऐ']='ē', | |||
['ऒ']='ou', | |||
['ओ']='ōu', | |||
['ऑ']='o', | |||
['औ']='ō', | |||
['ं']='̣', --until a better method is found | |||
['ः']='ḥ', | |||
['०']='0', ['१']='1', ['२']='2', ['३']='3', ['४']='4', ['५']='5', ['६']='6', ['७']='7', ['८']='8', ['९']='9', | |||
} | } | ||
Revision as of 23:32, 28 May 2026
- The following documentation is generated by Module:documentation/functions/translit. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
This module will transliterate Ancient Tevvic language text. It is also used to transliterate Middle Tevvic and Tevvic.
The module should preferably not be called directly from templates or other modules.
To use it from a template, use {{xlit}}.
Within a module, use Module:languages#Language:transliterate.
For testcases, see Module:tevo-translit/testcases.
Functions
tr(text, lang, sc)- Transliterates a given piece of
textwritten in the script specified by the codesc, and language specified by the codelang. - When the transliteration fails, returns
nil.
local export = {}
local consonants = {
['क']='k', ['ख']='kh', ['ग']='g', ['घ']='gh', ['ङ']='ṅ',
['च']='c', ['छ']='ch', ['ज']='j', ['झ']='jh', ['ञ']='ñ',
['ट']='ṭ', ['ठ']='ṭh', ['ड']='ḍ', ['ढ']='ḍh', ['ण']='ṇ',
['त']='t', ['थ']='th', ['द']='d', ['ध']='dh', ['न']='n',
['प']='p', ['फ']='ph', ['ब']='b', ['भ']='bh', ['म']='m',
['य']='y', ['र']='r', ['ल']='l', ['व']='v', ['ळ']='ḷ',
['श']='ś', ['ष']='ṣ', ['स']='s', ['ह']='h',
}
local diacritics = {
['ा']='ā',
['ि']='i',
['ी']='ī',
['ु']='u',
['ू']='ū',
["ॆ"]='ei',
['े']='ēi',
["ॅ"]='e',
['ै']='ē',
['ो']='ōu',
['ौ']='ō',
['्']='',
['॔']='́',
['॓']='̀',
}
local tt = {
-- vowels
['अ']='a',
['आ']='ā',
['इ']='i',
['ई']='ī',
['उ']='u',
['ऊ']='ū',
['ऎ']="ei",
['ए']='ēi',
['ऍ']='e',
['ऐ']='ē',
['ऒ']='ou',
['ओ']='ōu',
['ऑ']='o',
['औ']='ō',
['ं']='̣', --until a better method is found
['ः']='ḥ',
['०']='0', ['१']='1', ['२']='2', ['३']='3', ['४']='4', ['५']='5', ['६']='6', ['७']='7', ['८']='8', ['९']='9',
}
function export.tr(text, lang, sc)
if sc ~= "Deva" then
return nil
end
end
return export