localmHatnote=require('Module:Hatnote')localmHatlist=require('Module:Hatnote list')localmArguments--initialize lazilylocalmTableTools--initialize lazilylocallibraryUtil=require('libraryUtil')localcheckType=libraryUtil.checkTypelocalp={}-- Produces standard {{other uses}} implementationfunctionp.otheruses(frame)mArguments=require('Module:Arguments')mTableTools=require('Module:TableTools')localargs=mTableTools.compressSparseArray(mArguments.getArgs(frame))localtitle=mw.title.getCurrentTitle().prefixedTextreturnp._otheruses(args,{title=title})end-- Produces standard {{other uses2}} implementationfunctionp.otheruses2(frame)returnp._otheruses({},{title=(frame:getParent().args[1]ormw.title.getCurrentTitle().prefixedText)})end--Implements "other [x]" templates with otherText supplied at invocationfunctionp.otherX(frame)mArguments=require('Module:Arguments')mTableTools=require('Module:TableTools')localx=frame.args[1]localargs=mTableTools.compressSparseArray(mArguments.getArgs(frame,{parentOnly=true}))localoptions={title=mw.title.getCurrentTitle().prefixedText,otherText=x}returnp._otheruses(args,options)end-- Main generatorfunctionp._otheruses(args,options)--Type-checks and defaultscheckType('_otheruses',1,args,'table',true)args=argsor{}checkType('_otheruses',2,options,'table')ifnot(options.defaultPageoroptions.title)thenerror('No default title data provided in "_otheruses" options table',2)endlocalemptyArgs=truefork,vinpairs(args)doiftype(k)=='number'thenemptyArgs=falsebreakendendifemptyArgsthenargs={options.defaultPageormHatnote.disambiguate(options.title,options.disambiguator)}end--Generate and return hatnotelocaltext=mHatlist.forSeeTableToString({{use=options.otherTextand"other "..options.otherTextornil,pages=args}})returnmHatnote._hatnote(text)endreturnp