-- Module for TAMNAMS-related things as it pertains to mosses
-- Work in progress
local mos = require('Module:MOS')
local p = {}
-- Lookup table for official tamnams names
p.tamnams_name = {
['1L 1s'] = 'monowood',
['2L 2s'] = 'biwood',
['1L 5s'] = 'antimachinoid',
['2L 4s'] = 'malic',
['3L 3s'] = 'triwood',
['4L 2s'] = 'citric',
['5L 1s'] = 'machinoid',
['1L 6s'] = 'onyx',
['2L 5s'] = 'antidiatonic',
['3L 4s'] = 'mosh',
['4L 3s'] = 'smitonic',
['5L 2s'] = 'diatonic',
['6L 1s'] = 'archaeotonic',
['1L 7s'] = 'antipine',
['2L 6s'] = 'subaric',
['3L 5s'] = 'checkertonic',
['4L 4s'] = 'tetrawood',
['5L 3s'] = 'oneirotonic',
['6L 2s'] = 'ekic',
['7L 1s'] = 'pine',
['1L 8s'] = 'antisubneutralic',
['2L 7s'] = 'balzano',
['3L 6s'] = 'tcherepnin',
['4L 5s'] = 'gramitonic',
['5L 4s'] = 'semiquartal',
['6L 3s'] = 'hyrulic',
['7L 2s'] = 'armotonic',
['8L 1s'] = 'subneutralic',
['1L 9s'] = 'antisinatonic',
['2L 8s'] = 'jaric',
['3L 7s'] = 'sephiroid',
['4L 6s'] = 'lime',
['5L 5s'] = 'pentawood',
['6L 4s'] = 'lemon',
['7L 3s'] = 'dicoid',
['8L 2s'] = 'taric',
['9L 1s'] = 'sinatonic'
}
-- And prefixes
p.tamnams_prefix = {
['1L 1s'] = 'monwd-',
['2L 2s'] = 'biwd-',
['1L 5s'] = 'amech-',
['2L 4s'] = 'mal-',
['3L 3s'] = 'triwd-',
['4L 2s'] = 'citro-',
['5L 1s'] = 'mech-',
['1L 6s'] = 'on-',
['2L 5s'] = 'pel-',
['3L 4s'] = 'mosh-',
['4L 3s'] = 'smi-',
['5L 2s'] = 'dia-',
['6L 1s'] = 'arch-',
['1L 7s'] = 'apine-',
['2L 6s'] = 'subar-',
['3L 5s'] = 'check-',
['4L 4s'] = 'tetrawd-',
['5L 3s'] = 'oneiro-',
['6L 2s'] = 'ek-',
['7L 1s'] = 'pine-',
['1L 8s'] = 'ablu-',
['2L 7s'] = 'bal-',
['3L 6s'] = 'cher-',
['4L 5s'] = 'gram-',
['5L 4s'] = 'cthon-',
['6L 3s'] = 'hyru-',
['7L 2s'] = 'arm-',
['8L 1s'] = 'blu-',
['1L 9s'] = 'asina-',
['2L 8s'] = 'jara-',
['3L 7s'] = 'seph-',
['4L 6s'] = 'lime-',
['5L 5s'] = 'pentawd-',
['6L 4s'] = 'lem-',
['7L 3s'] = 'dico-',
['8L 2s'] = 'tara-',
['9L 1s'] = 'sina-'
}
-- And abbrevs
p.tamnams_abbrev = {
['1L 1s'] = 'wood',
['2L 2s'] = 'bw',
['1L 5s'] = 'amech',
['2L 4s'] = 'mal',
['3L 3s'] = 'trw',
['4L 2s'] = 'cit',
['5L 1s'] = 'mech',
['1L 6s'] = 'on',
['2L 5s'] = 'pel',
['3L 4s'] = 'mosh',
['4L 3s'] = 'smi',
['5L 2s'] = 'dia',
['6L 1s'] = 'arch',
['1L 7s'] = 'apine',
['2L 6s'] = 'subar',
['3L 5s'] = 'chk',
['4L 4s'] = 'ttw',
['5L 3s'] = 'onei',
['6L 2s'] = 'ek',
['7L 1s'] = 'pine',
['1L 8s'] = 'ablu',
['2L 7s'] = 'bal',
['3L 6s'] = 'ch',
['4L 5s'] = 'gram',
['5L 4s'] = 'cth',
['6L 3s'] = 'hyru',
['7L 2s'] = 'arm',
['8L 1s'] = 'blu',
['1L 9s'] = 'asi',
['2L 8s'] = 'jar',
['3L 7s'] = 'seph',
['4L 6s'] = 'lime',
['5L 5s'] = 'pw',
['6L 4s'] = 'lem',
['7L 3s'] = 'dico',
['8L 2s'] = 'tar',
['9L 1s'] = 'si'
}
-- Function for looking up a mos's name (octave-equivalent mosses only)
-- Also works for prefixes and abbrevs
function p.lookup_name(input_mos, lookup_type)
local input_mos = mos.parse(input_mos) or "5L 2s"
local lookup_type = lookup_type or "name"
if lookup_type == "name" or lookup_type == "NAME" then
return p.tamnams_name[scalesig]
elseif lookup_type == "prefix" or lookup_type == "PREFIX" then
return p.tamnams_prefix[scalesig]
elseif lookup_type == "abbrev" or lookup_type == "ABBREV" then
return p.tamnams_abbrev[scalesig]
else
return nil
end
end
function p.lookup_named_ancestor(input_mos)
end
function p.lookup_step_ratio(step_ratio)
end
function p.lookup_step_ratio_range(step_ratio)
end
return p