Module:Infobox RT: Difference between revisions
does function order matter |
added "arx" |
||
(4 intermediate revisions by the same user not shown) | |||
Line 19: | Line 19: | ||
local genfrac = frame.args["genfrac"] | local genfrac = frame.args["genfrac"] | ||
local method = frame.args["method"] | local method = frame.args["method"] | ||
local mapping = frame.args["mapping"] | |||
local mos = frame.args["mosses"] | local mos = frame.args["mosses"] | ||
local ploidacot = frame.args["ploidacot"] | local ploidacot = frame.args["ploidacot"] | ||
local pergen = frame.args["pergen"] | |||
local limit1 = frame.args["lim1"] | local limit1 = frame.args["lim1"] | ||
local comp1 = frame.args["comp1"] | local comp1 = frame.args["comp1"] | ||
Line 50: | Line 52: | ||
}) | }) | ||
-- autocalculating ploidacot | -- autocalculating ploidacot | ||
for num in mapping:gmatch("(%d+); ") do | for num in mapping:gmatch("(%d+); ") do | ||
table.insert(map, num) | table.insert(map, num) | ||
Line 71: | Line 73: | ||
cot = tonumber(lowermap[2]) | cot = tonumber(lowermap[2]) | ||
suffix = "gem" | suffix = "gem" | ||
else | |||
suffix = "arx" | |||
end | end | ||
elseif tonumber( | end | ||
if referent == "7" then | |||
suffix = "gem" | |||
elseif tonumber(referent) == 2 then -- edf | |||
equave_letter = "f" | equave_letter = "f" | ||
equave = "3/2" | equave = "3/2" | ||
referent = string.char(string.byte(subgroup, 5)) | referent = string.char(string.byte(subgroup, 5)) | ||
end | end | ||
elseif tonumber(equave) == 2 then | elseif tonumber(equave) == 2 then | ||
Line 107: | Line 111: | ||
shear = -1 | shear = -1 | ||
end | end | ||
end | |||
suffix = p.num2greeklet(tostring(shear)) .. p.num2greek(tostring(cot), "cot") .. suffix | |||
if ploid ~= "1" then | |||
suffix = p.num2greek(ploid,"ploid") .. "ploid " .. suffix | |||
end | end | ||
if ploidacot == "0" then | |||
if ploidacot == " | |||
ploidacot = suffix | ploidacot = suffix | ||
end | end | ||
Line 125: | Line 133: | ||
}) | }) | ||
table.insert(data, { | if mos ~= "0" then | ||
table.insert(data, { | |||
"MOS scales", | |||
mos | |||
}) | |||
end | |||
table.insert(data, { | table.insert(data, { | ||
Line 134: | Line 144: | ||
ploidacot | ploidacot | ||
}) | }) | ||
if pergen ~= "0" then | |||
table.insert(data, { | |||
"Pergen", | |||
pergen | |||
}) | |||
end | |||
-- error and stuff | |||
local oddlim | |||
if equave_letter == "o" then | |||
oddlim = "-[[odd limit]]) " | |||
elseif equave_letter == "t" then | |||
oddlim = "-[[throdd limit]]) " | |||
else | |||
oddlim = "-[[integer limit]]) " | |||
end | |||
local string1 = "(" .. limit1 .. oddlim .. acc1 .. "c" | |||
local string2 = "(" .. limit1 .. oddlim .. comp1 .. " notes" | |||
if limit2 ~= "0" then | |||
string1 = string1 .. "; <br> (" .. limit2 .. oddlim .. acc2 .. "c" | |||
string2 = string2 .. "; <br> (" .. limit2 .. oddlim .. comp2 .. " notes" | |||
end | |||
table.insert(data, { | table.insert(data, { | ||
"Minmax error", | "Minmax error", | ||
string1 | |||
}) | }) | ||
table.insert(data, { | table.insert(data, { | ||
"Target scale size", | "Target scale size", | ||
string2 | |||
}) | }) | ||
Line 189: | Line 222: | ||
end | end | ||
elseif number == "4" then | elseif number == "4" then | ||
greek = "tetra" | if purpose == "decade" then | ||
greek = "tessera" | |||
else | |||
greek = "tetra" | |||
end | |||
elseif number == "5" then | elseif number == "5" then | ||
greek = "penta" | if purpose == "decade" then | ||
greek = "pente" | |||
else | |||
greek = "penta" | |||
end | |||
elseif number == "6" then | elseif number == "6" then | ||
greek = "hexa" | if purpose == "decade" then | ||
greek = "hexe" | |||
else | |||
greek = "hexa" | |||
end | |||
elseif number == "7" then | elseif number == "7" then | ||
greek = "hepta" | if purpose == "decade" then | ||
greek = "hebdome" | |||
else | |||
greek = "hepta" | |||
end | |||
elseif number == "8" then | elseif number == "8" then | ||
greek = "octa" | if purpose == "decade" then | ||
greek = "ogdoe" | |||
elseif purpose == "unit" then | |||
greek = "octo" | |||
else | |||
greek = "octa" | |||
end | |||
elseif number == "9" then | elseif number == "9" then | ||
greek = "ennea" | if purpose == "decade" then | ||
greek = "enene" | |||
else | |||
greek = "ennea" | |||
end | |||
end | end | ||
if purpose == "decade" then | if purpose == "decade" then |