Module:TAMNAMS: Difference between revisions
m Changes to lookup table names |
m Bugfix for hardness lookup; revert "hardness_names" back to "step_ratio(s)" |
||
| Line 20: | Line 20: | ||
-- Lookup table for tamnams step ratios | -- Lookup table for tamnams step ratios | ||
p. | p.step_ratios = { | ||
['1:1'] = 'equalized', | ['1:1'] = 'equalized', | ||
['4:3'] = 'supersoft', | ['4:3'] = 'supersoft', | ||
| Line 33: | Line 33: | ||
-- And step ratio ranges | -- And step ratio ranges | ||
p. | p.step_ratio_ranges = { | ||
['1:1 to 2:1'] = 'soft-of-basic', | ['1:1 to 2:1'] = 'soft-of-basic', | ||
['1:1 to 3:2'] = 'soft', | ['1:1 to 3:2'] = 'soft', | ||
| Line 51: | Line 51: | ||
-- Lookup table for tamnams extended step ratios | -- Lookup table for tamnams extended step ratios | ||
p. | p.step_ratios_ext = { | ||
['1:1'] = 'equalized', | ['1:1'] = 'equalized', | ||
['6:5'] = 'semiequalized', | ['6:5'] = 'semiequalized', | ||
| Line 67: | Line 67: | ||
-- And extended step ratio ranges | -- And extended step ratio ranges | ||
p. | p.step_ratio_ranges_ext = { | ||
['1:1 to 2:1'] = 'soft-of-basic', | ['1:1 to 2:1'] = 'soft-of-basic', | ||
['1:1 to 3:2'] = 'soft', | ['1:1 to 3:2'] = 'soft', | ||
| Line 343: | Line 343: | ||
-- use_extended is used to toggle between central range and extended range | -- use_extended is used to toggle between central range and extended range | ||
local key = rat.as_ratio(step_ratio, ':') | local key = rat.as_ratio(step_ratio, ':') | ||
local named_ratio = use_extended and p. | local named_ratio = use_extended and p.step_ratios_ext[key] or p.step_ratios[key] | ||
return named_ratio | return named_ratio | ||
| Line 367: | Line 367: | ||
-- use_extended is used to toggle between central range and extended range | -- use_extended is used to toggle between central range and extended range | ||
local named_ratio_range = use_extended and p. | local named_ratio_range = use_extended and p.step_ratio_ranges_ext[key] or p.step_ratio_ranges[key] | ||
return named_ratio_range | return named_ratio_range | ||