Editing Module:Dict D'ni
From Guild of Archivists
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
local origArgs | local origArgs | ||
local root | local root | ||
local function getArgNums(prefix) | local function getArgNums(prefix) | ||
Line 74: | Line 25: | ||
local output = '' | local output = '' | ||
local sort = dnifont2ots(mw.ustring.sub(args['dnifont'],1,1)) | local sort = dnifont2ots(mw.ustring.sub(args['dnifont'],1,1)) | ||
output = output..' | output = output..'==D\'ni==\n' | ||
output = output..'{{huge|<d\'ni>'..args['dnifont']..'</d\'ni>}}\n' | |||
output = output..'{{huge|< | output = output..'===Romanization===' | ||
output = output..' | output = output..'* [[Dnifont]]: '..args['dnifont']..'\n' | ||
output = output..'* [[Dnifont]] | output = output..'* [[OTS]]: '..dnifont2ots(args['dnifont'])..'\n' | ||
output = output..'* [[OTS]] | output = output..'* [[NTS]]: '..dnifont2nts(args['dnifont'])..' ' | ||
output = output..'* [[NTS]] | output = output..'[[Category:D\'ni words beginning with '..sort..']]\n' | ||
output = output..'[[Category:D\'ni words beginning with '..sort..']]' | |||
output = output..'[[Category:D\'ni words|'..sort..']]' | output = output..'[[Category:D\'ni words|'..sort..']]' | ||
return output | return output | ||
Line 176: | Line 120: | ||
end | end | ||
function p.dnifont2ots(str) | |||
function p. | |||
local output = mw.text.trim(str) | |||
output = output:gsub("%S+", {["S"] = "sh", | |||
["T"] = "th", | |||
["O"] = "oy", | |||
["c"] = "ch", | |||
["a"] = "ah", | |||
["E"] = "ee", | |||
["A"] = "ay", | |||
["u"] = "uh", | |||
["U"] = "oo", | |||
["x"] = "ts", | |||
["d"] = "dh", | |||
["D"] = "d", | |||
["k"] = "kh", | |||
["K"] = "k", | |||
["I"] = "ai", | |||
["å"] = "a", | |||
}) | |||
return output | |||
end | end | ||
function p.dnifont2nts(str) | |||
local output = mw.text.trim(str) | |||
output = output:gsub("%S+", {["S"] = "š", | |||
["T"] = "þ", | |||
["O"] = "ó", | |||
["c"] = "ç", | |||
["E"] = "i", | |||
["A"] = "é", | |||
["U"] = "ú", | |||
["x"] = "c", | |||
["d"] = "ð", | |||
["D"] = "d", | |||
["k"] = "x", | |||
["K"] = "k", | |||
["I"] = "á", | |||
["å"] = "æ", | |||
}) | |||
return output | |||
end | end | ||
return p | return p |