FANDOM


-- <nowiki>
-- ORIGINAL DISCLAIMER BY Flightmare: Don't use this as lua example, it is my first script so it probably is very bad.
 
local p = {}
 
local doublelut = {
	["aa"] = true,
	["ah"] = true,
	["ei"] = true,
	["ey"] = true,
	["ii"] = true,
	["ir"] = true,
	["oo"] = true,
	["uu"] = true,
	["ur"] = true,
}
 
local singlelut = {
    ["a"] = true,
    ["b"] = true,
    ["d"] = true,
    ["e"] = true,
    ["f"] = true,
    ["g"] = true,
    ["h"] = true,
    ["i"] = true,
    ["j"] = true,
    ["k"] = true,
    ["l"] = true,
    ["m"] = true,
    ["n"] = true,
    ["o"] = true,
    ["p"] = true,
    ["q"] = true,
    ["r"] = true,
    ["s"] = true,
    ["t"] = true,
    ["u"] = true,
    ["v"] = true,
    ["w"] = true,
    ["x"] = true,
    ["y"] = true,
    ["z"] = true,
}
 
function parse(s, size, result)
	if string.len(s) == 0 then
		return result
	end
	if string.sub(s, 1, 1) == "_" then
		result = result .. "[[File:Spacer.png|" .. size .."]]"
		return parse(string.sub(s, 2), size, result)
	end
	if  doublelut[string.sub(s, 1, 2)] then
		result = result .. "[[File:" .. string.sub(s, 1, 2) .. ".svg|" .. size .."|link=]]"
		return parse(string.sub(s, 3), size, result)
	end
	if  singlelut[string.sub(s, 1, 1)] then
		result = result .. "[[File:" .. string.sub(s, 1, 1) .. ".svg|" .. size .."|link=]]"
	return parse(string.sub(s, 2), size, result)
	end
	return parse(string.sub(s, 2), size, result)
end
 
function p.transcribe(frame)
	local result = ''
	if(frame.args[2]) then
		size = frame.args[2]
	else
		size = "16px"
	end
	return parse (frame.args[1]:lower(), size, result)
end
 
return p
 
--</nowiki>

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on FANDOM

Random Wiki