localexport={}localfunctionfamily_is_not_a_family(fam)localfamcode=fam:getCode()iffamcode=="paa"thenreturnfalse-- Papuan languages are not a family but have a categoryelseiffamcode=="qfa-iso"orfamcode=="qfa-not"thenreturntrueelselocalparfam=fam:getFamily()ifparfamandparfam:getCode()=="qfa-not"then-- Constructed languages, sign languages, etc.; no category for themreturntrueendendreturnfalseendfunctionexport.show(text)iftype(text)=="table"then-- called directly from a templatetext=text.args[1]endlocalfamily_name=mw.ustring.match(text,"^กลุ่มภาษา(.+)$")localfamily=require("Module:families").getByCanonicalName(family_name)orrequire("Module:families").getByCanonicalName(mw.ustring.lower(family_name))localparent_fam=family:getFamily()localfirst_parentifnotparent_famorfamily_is_not_a_family(parent_fam)thenfirst_parent="ภาษาแบ่งตามกลุ่มภาษา"elsefirst_parent=parent_fam:getCategoryName()endreturnfirst_parentendreturnexport