Module:TAMNAMS: Difference between revisions

ArrowHead294 (talk | contribs)
m Trying to see what was broken; will either fix it or revert it back soon
Tag: Undo
Ganaram inukshuk (talk | contribs)
fixed issue with preprocessed scalesigs having a nonbreaking space instead of a normal space
Line 274: Line 274:
-- Mosses for name lookup are entered either as a scalesig or as a mos as
-- Mosses for name lookup are entered either as a scalesig or as a mos as
-- defined in the mos module. If of the latter, it's converted into a textual
-- defined in the mos module. If of the latter, it's converted into a textual
-- scalesig.
-- scalesig. Scalesigs should have a normal space, not a nonbreaking space, as
-- the lookup tables use a normal space.
function p.preprocess_scalesig(input_mos)
function p.preprocess_scalesig(input_mos)
if type(input_mos) == "string" then
if type(input_mos) == "string" then
return input_mos
local parsed_mos = mos.parse(input_mos)
return mos.as_string(parsed_mos, false)
elseif type(input_mos) == "table" then
elseif type(input_mos) == "table" then
return mos.as_string(input_mos)
return mos.as_string(input_mos, false)
else
else
return nil
return nil
Line 1,001: Line 1,003:


function p.tester()
function p.tester()
return ""
local input_mos = mos.new(5,2)
.. p.find_step_ratio_range_for_ratio_pair({1,1},{2,1}) .. "\n"
return p.preprocess_scalesig(input_mos)
.. p.find_step_ratio_range_for_ratio_pair({1,1},{3,2}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({1,1},{4,3}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({4,3},{3,2}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({3,2},{2,1}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({3,2},{5,3}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({5,3},{2,1}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({2,1},{5,2}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({5,2},{3,1}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({2,1},{3,1}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({3,1},{4,1}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({4,1},{1,0}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({3,1},{1,0}) .. "\n"
.. p.find_step_ratio_range_for_ratio_pair({2,1},{1,0}) .. "\n"
end
end


return p
return p