localexport={}functionexport.exists(frame)localargs=frame.argslocalfam=args[1]orerror("Family code has not been specified. Please pass parameter 1 to the module invocation.")fam=require("Module:families").getByCode(fam)iffamthenreturn"1"elsereturn""endendfunctionexport.getByCode(frame)localargs=frame.argslocalfam=args[1]orerror("Family code (parameter 1) has not been specified.")localitemname=args[2]orerror("Function to call (parameter 2) has not been specified.")fam=require("Module:families").getByCode(fam)orerror("The family code '"..fam.."' is not valid.")-- The item that the caller wanted to look upifitemname=="getCanonicalName"thenreturnfam:getCanonicalName()elseifitemname=="getOtherNames"thenlocalindex=args[3];ifindex==""thenindex=nilendindex=tonumber(indexorerror("Numeric index of the desired item in the list (parameter 3) has not been specified."))returnfam:getOtherNames()[index]or""elseifitemname=="getFamily"thenreturnfam:getFamily():getCode()elseifitemname=="getCategoryName"thenreturnfam:getCategoryName()elseerror("Requested invalid item name \""..itemname.."\".")endendfunctionexport.getByCanonicalName(frame)localargs=frame.argslocalfamname=args[1]orerror("Family name has not been specified. Please pass parameter 1 to the module invocation.")localfam=require("Module:families").getByCanonicalName(famname)iffamthenreturnfam:getCode()elsereturn""endendreturnexport