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

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

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

local export = {}

local U = require("Module:string/char")

local acute = U(0x301) -- combining acute
local grave = U(0x300) -- combining grave

local tt = {
	 = {
		-- consonants
		 = 'kh',  = 'gh',  = 'ṅ',
		 = 'ch',  = 'jh',  = 'ñ',
		 = 'ṭ',  = 'ṭh',  = 'ḍ',  = 'ḍh',  = 'ṇ',
		 = 'th',  = 'dh',  = 'ph',  = 'bh',
		 = 'ḷ',  = 'ś',  = 'ṣ',
		
		-- vowels
		 = 'ā',
		 = 'ī',
		 = 'ū',
		 = 'ṛ',  = 'ṝ',
		 = 'ḷ',  = 'ḹ',
		 = 'ai',
		 = 'au',
		
		-- chandrabindu
		 = 'm̐', --until a better method is found
		
		-- anusvara
		 = 'ṃ', --until a better method is found
		
		-- visarga
		 = 'ḥ',
		
		-- avagraha
		 = '’',
		
		--Vedic extensions
		 = acute,
		 = grave,
	},
	 = {
		--Vedic extensions
		 = 'x',
		 = 'f',
	},
}

function export.tr(text, lang, sc)
	
	text = mw.ustring.gsub(text, '.', tt)
	text = mw.ustring.gsub(text, '.', tt)
	
	return mw.ustring.toNFC(text)
end

return export