Module:sa-utilities/translit

Hello, you have come here looking for the meaning of the word Module:sa-utilities/translit. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:sa-utilities/translit, but we will also tell you about its etymology, its characteristics and you will know how to say Module:sa-utilities/translit in singular and plural. Everything you need to know about the word Module:sa-utilities/translit you have here. The definition of the word Module:sa-utilities/translit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:sa-utilities/translit, 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 lang = require("Module:languages").getByCode('sa')

function export.Deva_to_SLP_template(frame)
	local params = {
		 = { required = true },
	}
	local args = require("Module:parameters").process(frame:getParent().args, params)
	return require("Module:sa-utilities/translit/Deva-to-SLP1").tr(args)
end

--[=[
Converts Devanagari or IAST to SLP1.
]=]
function export.detect_to_SLP(text)
	local sc = lang:findBestScript(text):getCode()
	if sc == 'None' then
		sc = 'IAST'
	end
	return require('Module:sa-utilities/translit/' .. sc .. '-to-SLP1').tr(text)
end

function export.retrieve_tr_modules(sc)
	local tr = require('Module:sa-utilities/translit/' .. sc .. '-to-SLP1').tr
	local reverse_tr = require('Module:sa-utilities/translit/SLP1-to-' .. sc).tr
	local IAST_tr = require('Module:sa-utilities/translit/IAST-to-SLP1').tr
	
	local safe_tr = function(text)
		local sc = lang:findBestScript(text):getCode()
		if sc == 'None' then
			return IAST_tr(text)
		else
			return tr(text)
		end
	end
	return safe_tr, reverse_tr
end

return export