Module:lif-translit/sandbox

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


local export = {}
local gsub = mw.ustring.gsub
local consonants = {
	='k', ='kh', ='g', ='gh', ='ṅ', 
	='c', ='ch', ='j', ='jh', ='ny',
	='t', ='th', ='d', ='dh', ='n', 
	='p', ='ph', ='b', ='bh', ='m', 
	='y', ='r', ='l', ='w', 
	='ś', ='ṣ', ='s', ='h', 
	='gy', ='tr', ='',
}
local diacritics = {
	='a' , ='i' , ='u' , ='e' , ='ai' , ='o' , ='au' , ='ê' , ='ô'
}

local special = {
	-- idk what to call these
	='’', --mukphreng (glottalizer)
	 = '̃', --anusvara (now obsolete)
}

local subjoined = {
	='r', ='w', ='y',
}

local finals = {
	='k', ='ṅ', ='t', ='n', ='p', ='m', ='r', ='l',
}

local nonconsonants = { 
	
	-- digits
	 = '0',  = '1',  = '2',  = '3',  = '4',
	 = '5',  = '6',  = '7',  = '8',  = '9',
	='.', ='!', ='?',
	='lo'
}

-- 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, 'aᤣ', 'o')
text = gsub(text, 'ᤣᤣ', 'ai')
text = gsub(text, 'aᤣᤣ', 'au')
text = mw.ustring.gsub(text, '᤺', '̄')
text = mw.ustring.gsub(text, 'ᤰ', 'k')
text = mw.ustring.gsub(text, 'ᤱ', 'ṅ')
text = mw.ustring.gsub(text, 'ᤳ', 't')
text = mw.ustring.gsub(text, 'ᤴ', 'n')
text = mw.ustring.gsub(text, 'ᤵ', 'p')
text = mw.ustring.gsub(text, 'ᤶ', 'm')
text = mw.ustring.gsub(text, 'ᤷ', 'r')
text = mw.ustring.gsub(text, 'ᤸ', 'l')
text = gsub(text,  '̄ᤣ', 'ō')
text = mw.ustring.gsub(text, 'aō', 'ō')
	return mw.ustring.toNFC(text)
end
 
return export