Module:TAMNAMS lookup

From Xenharmonic Wiki
Revision as of 05:50, 6 August 2024 by Ganaram inukshuk (talk | contribs) (Created page with "local tamnams = require("Module:TAMNAMS") local yesno = require("Module:Yesno") local p = {} -- For TAMNAMS name lookup as a template, outside of a lua module. function p._t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Module documentation[view] [edit] [history] [purge]
This module should not be invoked directly; use its corresponding template instead: Template:TAMNAMS lookup.
Module:TAMNAMS lookup is a draft module. It is incomplete and may not be in active development. If possible, editors are encouraged to help with its development. In the meantime, editors should avoid using this module across the Xenharmonic Wiki, except for testing.
Introspection summary for Module:TAMNAMS lookup 
Functions provided (3)
Line Function Params
7 _tamnams_lookup (main) (text, reverse_lookup)
16 tamnams_lookup (invokable) (frame)
24 tester none
Lua modules required (2)
Variable Module Functions used
tamnams Module:TAMNAMS dependency not used
yesno Module:Yesno yesno

No function descriptions were provided. The Lua code may have further information.


local tamnams = require("Module:TAMNAMS")
local yesno = require("Module:Yesno")
local p = {}

-- For TAMNAMS name lookup as a template, outside of a lua module.

function p._tamnams_lookup(text, reverse_lookup)
	local result = tamnams.hardness_names[text] 
		or tamnams.hardness_ranges[text] 
		or tamnams.mos_names[text]
		or text
	
	return result
end

function p.tamnams_lookup(frame)
	local text = frame.args["Lookup"]
	local reverse_lookup = yesno(frame.args["Reverse Lookup"]) == true		-- TODO
	

	return p._tamnams_lookup(text, reverse_lookup, show_both)
end

function p.tester()
	return p._tamnams_lookup("5L 3s")
end

return p