Module:Infobox MOS: Difference between revisions
add todo |
No edit summary |
||
| Line 202: | Line 202: | ||
-- step count is 5 or less; currently unsupported) or not. | -- step count is 5 or less; currently unsupported) or not. | ||
local is_octave_equivalent = mos.is_octave_equivalent(input_mos) | local is_octave_equivalent = mos.is_octave_equivalent(input_mos) | ||
local is_within_named_range = | local has_tamnams_name = tamnams.lookup_name(input_mos) ~= nil | ||
local is_within_named_range = mos.step_count(input_mos) <= 10 | |||
local is_within_period_count = mos.period_count(input_mos) <= 5 | local is_within_period_count = mos.period_count(input_mos) <= 5 | ||
local is_root_mos = input_mos.nL == input_mos.ns | local is_root_mos = input_mos.nL == input_mos.ns | ||
| Line 208: | Line 209: | ||
local section_header = "TAMNAMS information" | local section_header = "TAMNAMS information" | ||
local section_entries = nil | local section_entries = nil | ||
if is_octave_equivalent and | if is_octave_equivalent and has_tamnams_name then | ||
section_entries = { | section_entries = { | ||
{string.format("<div style=\"margin-top: 0.6em;\"><b>%s</b></div>", section_header)}, | {string.format("<div style=\"margin-top: 0.6em;\"><b>%s</b></div>", section_header)}, | ||
| Line 215: | Line 216: | ||
{"[[TAMNAMS#Mos_pattern_names | Abbrev.]]", tamnams.lookup_abbrev(input_mos)} | {"[[TAMNAMS#Mos_pattern_names | Abbrev.]]", tamnams.lookup_abbrev(input_mos)} | ||
} | } | ||
elseif is_octave_equivalent and not | elseif is_octave_equivalent and not has_tamnams_name and not is_root_mos and not is_within_named_range then | ||
-- Lookup closest named ancestor mos | -- Lookup closest named ancestor mos | ||
local ancestor_mos, ratio_1, ratio_2, generations = tamnams.find_ancestor_info(input_mos) | local ancestor_mos, ratio_1, ratio_2, generations = tamnams.find_ancestor_info(input_mos) | ||