सामग्री पर जाएँ

मॉड्यूल:Brah-translit

विक्षनरी से

"इस मॉड्यूल हेतु प्रलेख मॉड्यूल:Brah-translit/doc पर बनाया जा सकता है"

local export = {}

local conv = {
	['𑀓']='क', ['𑀔']='ख', ['𑀕']='ग', ['𑀖']='घ', ['𑀗']='ङ',
	['𑀘']='च', ['𑀙']='छ', ['𑀚']='ज', ['𑀛']='झ', ['𑀜']='ञ', 
	['𑀝']='ट', ['𑀞']='ठ', ['𑀟']='ड', ['𑀠']='ढ', ['𑀡']='ण', 
	['𑀢']='त', ['𑀣']='थ', ['𑀤']='द', ['𑀥']='ध', ['𑀦']='न', 
	['𑀧']='प', ['𑀨']='फ', ['𑀩']='ब', ['𑀪']='भ', ['𑀫']='म',
	['𑀬']='य', ['𑀭']='र', ['𑀮']='ल', ['𑀯']='व', ['𑀴']='ळ',
	['𑀰']='श', ['𑀱']='ष', ['𑀲']='स', ['𑀳']='ह',

	--matras
	['𑀸']='ा', ['𑀺']='ि', ['𑀻']='ी', ['𑀼']='ु', ['𑀽']='ू', ['𑀾']='ृ', ['𑀿']='ॄ', 
	['𑁀']='ॢ', ['𑁁']='ॣ', ['𑁂']='े', ['𑁃']='ै', ['𑁄']='ो', ['𑁅']='ौ',  ['𑁆']='्',
    --bhattiprolu aa
    ['𑀹']='ा',

    --vowels
	['𑀅']='अ', ['𑀆']='आ', ['𑀇']='इ', ['𑀈']='ई', ['𑀉']='उ', ['𑀊']='ऊ', ['𑀋']='ऋ', ['𑀌']='ॠ',
	['𑀍']='ऌ', ['𑀎']='ॡ', ['𑀏']='ए', ['𑀐']='ऐ', ['𑀑']='ओ', ['𑀒']='औ', 
	-- chandrabindu    
	['𑀀']='ँ', --until a better method is found
	-- anusvara    
	['𑀁']='ं', --until a better method is found
	-- visarga    
	['𑀂']='ः',
	--numerals
	['𑁦']='0', ['𑁧']='1', ['𑁨']='2', ['𑁩']='3', ['𑁪']='4', ['𑁫']='5', ['𑁬']='6', ['𑁭']='7', ['𑁮']='8', ['𑁯']='9',
	--punctuation        
	['𑁇']='।', --danda
    ['𑁈']='॥' --double danda
}

function export.tr(text, lang, sc)
	if sc ~= "Brah" then
		return nil
	end
	
	text = mw.ustring.gsub(
		text,
		'(.)',
		function(c)
			return conv[c]
		end)
	
	return text
end
 
return export