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

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


local export = {}

local consonant_list = "kKgGNcCjJYwWqQRtTdDnpPbBmyrlLvSzsh"
local consonant = ""
local vowel_list = "aAiIuUfFxXeEoO"
local vowel = ""

local U = mw.ustring.char

local virAma = U(0x0DCA)

local diacritics = {
	 = '',  = 'ා',
	 = 'ි',  = 'ී',
	 = 'ු',  = 'ූ',
	 = 'ෘ',  = 'ෲ',
	 = 'ෟ',  = 'ෳ',
	 = 'ෙ',  = 'ෛ',
	 = 'ො',  = 'ෞ',
}

local tt = {
	-- consonants
	 = 'ක',  = 'ඛ',  = 'ග',  = 'ඝ',  = 'ඞ',
	 = 'ච',  = 'ඡ',  = 'ජ',  = 'ඣ',  = 'ඤ',
	 = 'ට',  = 'ඨ',  = 'ඩ',  = 'ඪ',  = 'ණ',
	 = 'ත',  = 'ථ',  = 'ද',  = 'ධ',  = 'න',
	 = 'ප',  = 'ඵ',  = 'බ',  = 'භ',  = 'ම',
	 = 'ය',  = 'ර',  = 'ල',  = 'ව',  = 'ළ',
	 = 'ශ',  = 'ෂ',  = 'ස',  = 'හ',
	-- vowels
	 = "අ",  = "ආ",
	 = "ඉ",  = "ඊ",
	 = "උ",  = "ඌ",
	 = "ඍ",  = "ඎ",
	 = "ඏ",  = "ඐ",
	 = "එ",  = "ඓ",
	 = "ඔ",  = "ඖ",
	-- chandrabindu
	 = 'ඁ',
	-- anusvara
	 = 'ං',
	-- visarga
	 = 'ඃ',
	-- avagraha
	--  = 'ऽ',
	--numerals
	--- Unchanged
--	 = '०',  = '१',  = '२',  = '३',  = '४',  = '५',  = '६',  = '७',  = '८',  = '९',
	--Vedic extensions
--	 = 'ᳵ',
--	 = 'ᳶ',
	 = '',
	 = '',
}

-- local fixes = mw.loadData('Module:sa-utilities/translit/post replace fix/Sinh')
local fixes = require('Module:sa-utilities/translit/post replace fix/Sinh')
function export.tr(text, lang, sc)
	-- capture twice so that all adjacent pairs are covered
	text = mw.ustring.gsub(text, "(" .. consonant .. ")" .. "(" .. consonant .. ")", "%1" .. virAma .. "%2")
	text = mw.ustring.gsub(text, "(" .. consonant .. ")" .. "(" .. consonant .. ")", "%1" .. virAma .. "%2")
	-- whitespace and end of string
	text = mw.ustring.gsub(text, "(" .. consonant .. ")%f", "%1" .. virAma)
	-- all vowel diacritics
	text = mw.ustring.gsub(text, "(" .. consonant .. ")(" .. vowel ..  ")",
							function(c, v) return c .. diacritics end)
	-- everything else
	text = mw.ustring.gsub(text, '.', tt)
-- Elaborate
    for _, data in ipairs(fixes) do
		text = mw.ustring.gsub(text, data, data)
	end
	return text
--	return mw.ustring.toNFC(text)
end

return export