মডিউল:hi-translit/খেলাঘর
অবয়ব
এই মডিউলের জন্য মডিউল:hi-translit/খেলাঘর/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে
-- Transliteration for Hindi (possibly other languages using Devanagari script, except for Sanskrit)
local export = {}
local consonants = {
['क']='ক', ['ख']='খ', ['ग']='গ', ['घ']='ঘ', ['ङ']='ঙ',
['च']='চ', ['छ']='ছ', ['ज']='জ', ['झ']='ঝ', ['ञ']='ঞ',
['ट']='ট', ['ठ']='ঠ', ['ड']='ড', ['ढ']='ঢ', ['ण']='ণ',
['त']='ত', ['थ']='থ', ['द']='দ', ['ध']='ধ', ['न']='ন',
['प']='প', ['फ']='ফ', ['ब']='ব', ['भ']='ভ', ['म']='ম',
['य']='য়', ['र']='র', ['ल']='ল', ['व']='ৱ', ['ळ']='ল়',
['श']='শ', ['ष']='ষ', ['स']='স', ['ह']='হ',
['क़']='ক়', ['ख़']='খ়', ['ग़']='গ়', ['ज़']='জ়', ['झ़']='ঝ়',
['ड़']='ড়', ['ढ़']='ঢ়', ['फ़']='ফ়',
}
local diacritics = {
['ा']='া', ['ि']='ি', ['ी']='ী', ['ु']='ু', ['ू']='ূ', ['ृ']='ৃ', ['ॄ']='ৄ',
['ॢ']='ৢ', ['ॣ']='ৣ', ['े']='ে', ['ै']='ৈ', ['ो']='ো', ['ौ']='ৌ', ['्']='্',
['ॊ'] = 'ো', ['ॆ'] = 'ে', ['ॉ'] = 'া', ['ॅ'] = '্যা',
}
local tt = {
-- vowels
['अ']='অ', ['आ']='আ', ['इ']='ই', ['ई']='ঈ', ['उ']='উ', ['ऊ']='ঊ', ['ऋ']='ঋ', ['ॠ']='ৠ',
['ऌ']='ঌ', ['ॡ']='ৡ', ['ए']='এ', ['ऐ']='ঐ', ['ओ']='ও', ['औ']='ঔ',
['ऒ'] = 'ও', ['ऎ'] = 'এ', ['ऑ'] = 'আ', ['ऍ'] = 'অ্যা',
-- chandrabindu
['ँ']='ঁ', --until a better method is found
-- anusvara
['ं']='ং', --until a better method is found
-- visarga
['ः']='ঃ',
-- avagraha
['ऽ']='ঽ',
--numerals
['०']='০', ['१']='১', ['२']='২', ['३']='৩', ['४']='৪', ['५']='৫', ['६']='৬', ['७']='৭', ['८']='৮', ['९']='৯',
--punctuation
['॥']='।।', --double danda
['।']='।', --danda
--Vedic extensions
['ᳵ']='ক়', ['ᳶ']='ফ়',
--Om
['ॐ']='ওঁ',
--reconstructed
['*'] = '',
--accentuation (needs to be handled)
['॑'] = '', ['॒'] = ''
}
function export.tr(text, lang, sc)
text = mw.ustring.gsub(
text,
'([कखगघङचछजझञटठडढणतथदधनपफबभमयरलळवशषसह])'..
'([ािीुूृॄॢॣेैोौ्ॅॆॉॊ]?)',
function(c, d)
if d == "" then
return consonants[c]
else
return consonants[c] .. diacritics[d]
end
end)
text = mw.ustring.gsub(text, '.', tt)
return text
end
return export