Module:sa-utilities/translit/Sinh-to-SLP1

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


local export = {}
local u = mw.ustring.char

local consonants = {
	 = 'k',  = 'K',  = 'g',  = 'G',  = 'Ng',  = 'N',
	 = 'c',  = 'C',  = 'j',  = 'J',  = 'Yj',  = 'Y',  = 'jY',
	 = 'w',  = 'W',  = 'q',  = 'Q',  = 'Rq',  = 'R',
	 = 't',  = 'T',  = 'd',  = 'D',  = 'nd',  = 'n',
	 = 'p',  = 'P',  = 'b',  = 'B',  = 'mb',  = 'm',
	 = 'y',  = 'r',  = 'l',  = 'v',  = 'L',
	 = 'S',  = 'z',  = 's',  = 'h',
}

local diacritics = {
 = '',  = 'A',
	 = 'i',  = 'I',
	 = 'u',  = 'U',
	 = 'f',  = 'F',
	 = 'x',  = 'X',
	 = 'e',  = 'e',  = 'E',
	 = 'o',  = 'o',  = 'O',
}

local tt = {
	-- vowels
	 = 'a',  = 'A',
	 = 'i',  = 'I',
	 = 'u',  = 'U',
	 = 'f',  = 'F',
	 = 'x',  = 'X',
	 = 'e',  = 'e',  = 'E',
	 = 'o',  = 'o',  = 'O',
	-- chandrabindu
	 = '~', -- Probably much more complicated.
	-- anusvara
	 = 'M',
	-- visarga
	 = 'H',
	-- avagraha
	--  = '',
	--numerals -- Modern digits are Western Arabic
--	 = '0',  = '1',  = '2',  = '3',  = '4',  = '5',  = '6',  = '7',  = '8',  = '9',
	--punctuation
	 = '.', --double danda
	 = '.', --danda
	--Vedic extensions - Probably unsupported.
	 = 'Z',
	 = 'V',
	--Om
	 = 'oM',
	 = '/',
}

local function dc(x) return string.gsub(x, 'ක', '') end -- Drop Carrier
function export.tr(text, lang, sc)
	text = string.gsub(text, u(0x200d), '') -- Drop ZWJ
	local vowels = dc('ක්කාකිකීකෘකෟකෲකෳකුකූකෙකේකෛකොකෝකෞ') -- Use carrier for readability.
	text = mw.ustring.gsub(text,
		'()' .. '(?)',
		function(c, d)
			if d == "" then
				return consonants .. 'a'
			else
				return consonants .. diacritics
			end
		end)
	
	text = mw.ustring.gsub(text, '.', tt)
	
	return text
end

return export