Module:Limb-Deva-translit

Hello, you have come here looking for the meaning of the word Module:Limb-Deva-translit. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:Limb-Deva-translit, but we will also tell you about its etymology, its characteristics and you will know how to say Module:Limb-Deva-translit in singular and plural. Everything you need to know about the word Module:Limb-Deva-translit you have here. The definition of the word Module:Limb-Deva-translit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:Limb-Deva-translit, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module will transliterate text in the Limbu script. 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:Limb-Deva-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 gsub = mw.ustring.gsub
local consonants = {
	='क', ='ख', ='ग', ='घ', ='ङ', 
	='च', ='छ', ='ज', ='झ', ='ञ',
	='त', ='थ', ='द', ='ध', ='न', 
	='प', ='फ', ='ब', ='भ', ='म', 
	='य', ='र', ='ल', ='व', 
	='श', ='ष', ='स', ='ह', 
	='ज्ञ', ='त्र', ='अ',
}
local diacritics = {
	='ा' , ='ि' , ='ु' , ='े' , ='ै' , ='ो' , ='ौ' , ='े़' , ='ो़'
}

--='ॅ' , --='',

local special = {
	='ॽ', --mukphreng (glottalizer)
	 = 'ं' --anusvara (now obsolete)
}

local subjoined = {
	='्र', ='्व', ='्य',
}

local finals = {
	='क्', ='ङ्', ='त्', ='न्', ='प्', ='म्', ='र्', ='ल्',
}

local nonconsonants = { 
	
	-- digits
	 = '०',  = '१',  = '२',  = '३',  = '४',
	 = '५',  = '६',  = '७',  = '८',  = '९',
	='॥', ='!', ='?', =',', 
	='लो'
}

-- translit any words or phrases
function export.tr(text, lang, sc)
	text = mw.ustring.gsub(text, '()᤻', '᤺%1') -- treat underscore as kemphreng
	text = mw.ustring.gsub(
		text,
		'()'..
		'(?)'..
		'(?)'..
		'(?)'..
		'(?)',
		function(c, d, e, f, g)
			-- mw.log('match', c, d)
			return (consonants or c) ..
					(subjoined or d) ..
					(diacritics or (e ~= "") and e or '') ..
					(special or f) ..
					(finals or g)
		end)
	
	
text = mw.ustring.gsub(text, '.', nonconsonants)	
text = mw.ustring.gsub(text, '(.)⌫', '')
text = gsub(text, 'ाᤣ', 'ो')
text = gsub(text, 'ᤣᤣ', 'ै')
text = gsub(text, 'ाᤣᤣ', 'ौ')
text = gsub(text, 'ाःᤣ', 'ओः')
text = mw.ustring.gsub(text, '᤺', 'ः')
--text = mw.ustring.gsub(text, 'िः', 'ी')
--text = mw.ustring.gsub(text, 'ुः', 'ू')
text = mw.ustring.gsub(text, 'ᤰ', 'क्')
text = mw.ustring.gsub(text, 'ᤱ', 'ङ्')
text = mw.ustring.gsub(text, 'ᤳ', 'त्')
text = mw.ustring.gsub(text, 'ᤴ', 'न्')
text = mw.ustring.gsub(text, 'ᤵ', 'प्')
text = mw.ustring.gsub(text, 'ᤶ', 'म्')
text = mw.ustring.gsub(text, 'ᤷ', 'र्')
text = mw.ustring.gsub(text, 'ᤸ', 'ल्')
text = mw.ustring.gsub(text, "अा", "आ")
text = mw.ustring.gsub(text, "अि", "इ")
text = mw.ustring.gsub(text, "अी", "ई")
text = mw.ustring.gsub(text, "अु", "उ")
text = mw.ustring.gsub(text, "अू", "ऊ")
text = mw.ustring.gsub(text, "अे", "ए")
text = mw.ustring.gsub(text, "अै", "ऐ")
text = mw.ustring.gsub(text, "अो", "ओ")
text = mw.ustring.gsub(text, "अौ", "औ")
text = mw.ustring.gsub(text, "अॅ", "ऍ")
text = mw.ustring.gsub(text, "अे़", "ए़")
text = mw.ustring.gsub(text, "अो़", "ओ़")
text = gsub(text,  'ाःᤣ', 'ोः')
text = mw.ustring.gsub(text, 'ाःᤣ', 'ोः')
	return mw.ustring.toNFC(text)
end
 
return export