Módulu:Distinguish

La documentación pa esti módulu pue crease en Módulu:Distinguish/usu

local mHatnote = require('Módulu:Hatnote')
local mHatlist = require('Módulu:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}

function p.distinguish(frame)
	mArguments = require('Módulu:Argumentos')
	mTableTools = require('Módulu:TableTools')
	local args = mArguments.getArgs(frame)
	local selfref = args.selfref
	local text = args.text
	local con = args.con
	args = mTableTools.compressSparseArray(args)
	return p._distinguish(args, text, selfref, con)
end

function p._distinguish(args, text, selfref, con)
	checkType("_distinguish", 1, args, 'table')
	if #args == 0 and not text then return '' end
	local text = string.format(
		'Nun confundir %s %s.',
		con or 'con',
		text or mHatlist.orList(args, true)
	)
	hnOptions = {selfref = selfref}
	return mHatnote._hatnote(text, hnOptions)
end

return p