Module:Sandbox/RexxS/GenerateIDs

Revision as of 02:28, 13 November 2019 by imported>RexxS (match the whole string)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Sandbox/RexxS/GenerateIDs/doc

--[[
Module:GenerateIDs
--]]

p = {}

--[[ 
This generates the second ID,
which is the term in lower-case if it begins with an upper case letter,
or nothing otherwise.
--]]
function p.second(frame)
	local args = frame:getParent().args
	local term = args.id or args.term or args[1] or ""
	if term == "" then
		args= frame.args
		term = args.id or args.term or args[1] or ""
		if term == "" then return nil end
	end
	return (term:match("^%u.*$") or ""):lower()
end

return p