localexport={}locallinks=require("Module:links")locallang=require("Module:languages").getByCode("th")localscript=require("Module:scripts").getByCode("Thai")localPAGENAME=mw.title.getCurrentTitle().textlocalfunctioncontains(table,val)fori=1,#tabledoiftable[i]==valthenreturntrueendendreturnfalseendlocalfunctionget_alphagram(word)word=mw.ustring.upper(word)-- it may applyword=mw.ustring.gsub(word,"[%p%c%s…]","")localcharTbl=mw.text.split(word,"")table.sort(charTbl)returntable.concat(charTbl,"")endfunctionexport.show(frame)localargs=frame:getParent().argslocalhead=((frame.args[1]==""orframe.args[1]==nil)andPAGENAMEorframe.args[1])localalphagram=get_alphagram(head)localoutput={}locallist=require("Module:th-anagram/processed data")[alphagram]iflistthenfor_,terminipairs(list)doifterm~=headthentable.insert(output,links.full_link({lang=lang,term=term,sc=script}))endendendreturn"<ul><li>"..table.concat(output,", ").."</li></ul>"endreturnexport