Jump to content

Module:Svara/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Renamed user ExPsittacine (talk | contribs) at 20:26, 14 September 2018. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local mSep = require('Module:Separated entries')
local getArgs = require('Module:Arguments').getArgs

local p = {}

function p.convertHindustani(input)
	local svaras = {
		["'s"] = 'Ṣ', -- sa (one octave below)
		['s'] = 'S',
		['S'] = 'S',
		['r'] = 'R', -- Komal re
		['R'] = 'R', -- Shuddha re
		['g'] = '{{underline|G}}', -- Komal ga
		['G'] = 'G', -- Shuddha ga
		['m'] = 'M', -- ma
		['M'] = 'M̄', -- Tivra ma
		['p'] = 'P',
		['P'] = 'P',
		['d'] = 'Ḏ', -- Komal dha
		['D'] = 'D', -- Shuddha dha
		['n'] = 'Ṉ', -- Komal ni
		['N'] = 'N', -- shuddha ni
		["S'"] = 'Ṡ', -- sa (one octave above)
	}
	for key, value in pairs(input) do
      input[key] = svaras[value];
    end
    
	return input
end

function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end

function p._main(args)
	args['separator'] = " "
    return mSep.main(args)
end

function p.hindustani(frame)
	local args = getArgs(frame)
	args = p.convertHindustani(args)
	return p._hindustani(args)
end

function p._hindustani(args)
	args['separator'] = " "
    return mSep.main(args)
end

return p