Module:tevo-translit: Difference between revisions

From Linguifex
Jump to navigation Jump to search
Melinoë (talk | contribs)
No edit summary
Melinoë (talk | contribs)
No edit summary
(One intermediate revision by the same user not shown)
Line 25: Line 25:
['्']='',
['्']='',
['॔']='́',
['॔']='́',
['॓']='̀',
['॓']='́',
['ं']='̣', --until a better method is found


}
}
Line 45: Line 46:
['ऑ']='o',
['ऑ']='o',
['औ']='ō',
['औ']='ō',
['ं']='̣', --until a better method is found
['ः']='ḥ',
['ः']='ḥ',
['०']='0', ['१']='1', ['२']='2', ['३']='3', ['४']='4', ['५']='5', ['६']='6', ['७']='7', ['८']='8', ['९']='9',
['०']='0', ['१']='1', ['२']='2', ['३']='3', ['४']='4', ['५']='5', ['६']='6', ['७']='7', ['८']='8', ['९']='9',

Revision as of 23:34, 28 May 2026


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 text written in the script specified by the code sc, and language specified by the code lang.
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',
	['ौ']='ō',
	['्']='',
	['॔']='́',
	['॓']='́',
	['ं']='̣', --until a better method is found

}

local tt = {
	-- vowels
	['अ']='a', 
	['आ']='ā', 
	['इ']='i',
	['ई']='ī',
	['उ']='u',
	['ऊ']='ū', 
	['ऎ']="ei",
	['ए']='ēi',
	['ऍ']='e',
	['ऐ']='ē',
	['ऒ']='ou',
	['ओ']='ōu', 
	['ऑ']='o',
	['औ']='ō',
	['ः']='ḥ',
	['०']='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