Module:TAMNAMS: Difference between revisions

Ganaram inukshuk (talk | contribs)
Added name/prefix/abbrev verifier functions, for use with templates that potentially require outside-of-tamnams names/prefixes/abbrevs
Ganaram inukshuk (talk | contribs)
Decided against having a name verifier as none of them have a name field, only prefix and abbrev
Line 284: Line 284:
------------------------ TEMPLATE HELPER FUNCTIONS -----------------------------
------------------------ TEMPLATE HELPER FUNCTIONS -----------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Verifier function that checks for a name that's already provided by TAMNAMS.
-- If there is one provided, use that. If there is none, use the name passed in.
-- If no name is provided or the string "NONE" is entered, use the scalesig.
function p.verify_name(input_mos, mos_name)
local mos_name = p.lookup_name(input_mos) or mos_name or mos.as_string(input_mos)
if mos_name == "NONE" or mos_name == "" then
mos_name = mos.as_string(input_mos)
end
return mos_name
end


-- Verifier function that checks for a prefix already provided by TAMNAMS.
-- Verifier function that checks for a prefix already provided by TAMNAMS.