Module:za

local export = {} local gsub = mw.ustring.gsub

local function genPoS(text) local pos = { [""] = "noun", ["n"] = "noun", ["pn"] = "proper noun", ["propn"] = "proper noun", ["pron"] = "pronoun", ["v"] = "verb", ["a"] = "adjective", ["adj"] = "adjective", ["adv"] = "adverb", ["prep"] = "preposition", ["postp"] = "postposition", ["conj"] = "conjunction", ["part"] = "particle", ["pref"] = "prefix", ["suf"] = "suffix", ["prov"] = "proverb", ["id"] = "idiom", ["ph"] = "phrase", ["intj"] = "interjection", ["interj"] = "interjection", ["cl"] = "classifier", ["cls"] = "classifier", ["num"] = "numeral", ["abb"] = "abbreviation", ["deter"] = "determiner" }	return pos[text] or text end

--modified from MOD:th function export.new(frame) local title = mw.title.getCurrentTitle.text local args = frame:getParent.args local pos = genPoS(args[1] or "") local def = args[2] or "" local etym = args["e"] or false local head = args["head"] or false local saw = args["saw"] or false local cls = args["cls"] or false local cat = args["cat"] or false local wp = args["wp"] or false local result = {} local function other(class, title, args) local code = "" if args[class] then code = code .. "\n\n===" .. title .. "===\n" end return code end table.insert(result, "==Zhuang==") if wp then table.insert(result, "\n") end table.insert(result, other("alt", "Alternative forms", args)) if etym then table.insert(result, "\n\n===Etymology===\n" .. etym) end table.insert(result, "\n\n===Pronunciation===\n* ") local pos_title = gsub(pos, "^.", mw.ustring.upper) table.insert(result, "\n\n===" .. pos_title .. "===\n\n\n# " .. def) table.insert(result, other("syn", "=Synonyms=", args)) table.insert(result, other("ant", "=Antonyms=", args)) table.insert(result, other("der", "=Derived terms=", args)) table.insert(result, other("rel", "=Related terms=", args)) table.insert(result, other("also", "=See also=", args)) if cat then table.insert(result, "\n\n") end return table.concat(result) end

return export