Module:ET: Difference between revisions
mNo edit summary |
m Testing another representation of special properties |
||
Line 99: | Line 99: | ||
-- describe why | -- describe why | ||
function p.why_highly_melodic(et) | function p.why_highly_melodic(et, debug_mode) | ||
et.highly_composite = et.highly_composite or rat.is_highly_composite(et.size) | et.highly_composite = et.highly_composite or rat.is_highly_composite(et.size) | ||
et.superabundant = et.superabundant or rat.is_superabundant(et.size) | et.superabundant = et.superabundant or rat.is_superabundant(et.size) | ||
if et.highly_composite and et.superabundant then | if et.highly_composite and et.superabundant then | ||
return 'highly composite,<br>superabundant' | if debug_mode then | ||
return 'highly composite, superabundant' | |||
else | |||
return 'highly composite,<br>superabundant' | |||
end | |||
elseif et.highly_composite then | elseif et.highly_composite then | ||
return 'highly composite' | return 'highly composite' | ||
Line 121: | Line 125: | ||
-- describe why | -- describe why | ||
function p.why_zeta(et) | function p.why_zeta(et, debug_mode) | ||
local zeta_peak = seq.contains(seq.zeta_peak, et.size) | local zeta_peak = seq.contains(seq.zeta_peak, et.size) | ||
local integral_zeta = seq.contains(seq.integral_zeta, et.size) | local integral_zeta = seq.contains(seq.integral_zeta, et.size) | ||
Line 128: | Line 132: | ||
local markers = {} | local markers = {} | ||
if zeta_peak then | if zeta_peak then | ||
table.insert(markers, 'peak') | if debug_mode then | ||
table.insert(markers, 'zeta peak') | |||
else | |||
table.insert(markers, 'peak') | |||
end | |||
elseif zeta_peak == nil then | elseif zeta_peak == nil then | ||
table.insert(markers, 'peak?') | if debug_mode then | ||
table.insert(markers, 'zeta peak?') | |||
else | |||
table.insert(markers, 'peak?') | |||
end | |||
end | end | ||
if integral_zeta then | if integral_zeta then | ||
table.insert(markers, 'integral') | if debug_mode then | ||
table.insert(markers, 'integral of zeta') | |||
else | |||
table.insert(markers, 'integral') | |||
end | |||
elseif integral_zeta == nil then | elseif integral_zeta == nil then | ||
table.insert(markers, 'integral?') | if debug_mode then | ||
table.insert(markers, 'integral of zeta?') | |||
else | |||
table.insert(markers, 'integral?') | |||
end | |||
end | end | ||
if zeta_gap then | if zeta_gap then | ||
table.insert(markers, 'gap') | if debug_mode then | ||
table.insert(markers, 'zeta gap') | |||
else | |||
table.insert(markers, 'gap') | |||
end | |||
elseif zeta_gap == nil then | elseif zeta_gap == nil then | ||
table.insert(markers, 'gap?') | if debug_mode then | ||
table.insert(markers, 'zeta gap?') | |||
else | |||
table.insert(markers, 'gap?') | |||
end | |||
end | end | ||
return table.concat(markers, ', ') | return table.concat(markers, ', ') |