မဝ်ဂျူ:aot-headword
မံက်ပြာကတ်
Documentation for this module may be created at မဝ်ဂျူ:aot-headword/doc
local export = {}
local pos_functions = {}
local lang = require("Module:languages").getByCode("aot")
local PAGENAME = mw.title.getCurrentTitle().text
local script = require("Module:scripts").findBestScript(PAGENAME, lang) -- Latn or Beng
function export.show(frame)
local args = frame:getParent().args
local poscat = frame.args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
local data = {lang = lang, sc = script, pos_category = poscat, sccat = true, categories = {}, heads = {args["head"] or PAGENAME}, translits = {args["tr"]}, inflections = {}}
local beng = {label = "အက္ခရ်ဘင်္ဂါလဳ", lang = lang, sc = require("Module:scripts").getByCode("Beng")}
if args[1] then table.insert(beng, args[1]) end
if args[2] then table.insert(beng, args[2]) end
if args[3] then table.insert(beng, args[3]) end
if args[4] then table.insert(beng, args[4]) end
if #beng > 0 then table.insert(data.inflections, beng) end
if pos_functions[poscat] then
pos_functions[poscat](args, data)
end
return require("Module:headword").full_headword(data)
end
pos_functions["ကြိယာ"] = function(args, data)
--verb is always prefix
data.heads[1] = data.heads[1] .. "-"
end
pos_functions["classifiers"] = function(args, data)
--classifier is always prefix
data.heads[1] = data.heads[1] .. "-"
end
pos_functions["နာမဝိသေသန"] = function(args, data)
--adjective can be either type 1 or type 2
if args["t"] ~= "1" and args["t"] ~= "2" then
args["t"] = "?"
end
--adjective type 1 is prefix
if args["t"] == "1" then
data.heads[1] = data.heads[1] .. "-"
end
table.insert(data.inflections, {label = "type " .. args["t"]})
end
return export