Deploys the Waray-Waray headword-line templates.
local export = {}
local pos_functions = {}
local lang = require("Module:languages").getByCode("war")
local PAGENAME = mw.title.getCurrentTitle().text
local script = lang:findBestScript(PAGENAME) -- Latn
function export.show(frame)
local tracking_categories = {}
local args = frame:getParent().args
local poscat = frame.args or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
local head = {} -- supports multiple headword
if args or args then table.insert(head, args or args) end
if args or args then table.insert(head, args or args) end
if args or args then table.insert(head, args or args) end
local data = {lang = lang, sc = script, pos_category = poscat, categories = {}, heads = head, translits = {"-"}, inflections = {}}
if pos_functions then
pos_functions(args, data)
end
local content = mw.title.new(PAGENAME):getContent()
local code = content and mw.ustring.match(content, "{{war%-IPA*}}")
--Categorize words without ]
if script:getCode() == "Latn" and not code then
table.insert(tracking_categories, "Waray-Waray terms without war-IPA template")
end
return require("Module:headword").full_headword(data) .. require("Module:utilities").format_categories(tracking_categories, lang)
end
pos_functions = function(args, data)
params = {
= {alias_of = 'head'},
= {alias_of = 'real'}, --realis aspect
= {alias_of = 'imp'}, --imperative
head = {list = true},
head2= {},
head3= {},
real = {list = true},
imp = {list = true},
dim = {list = true},
caus = {list = true},
freq = {list = true},
}
local args = require("Module:parameters").process(args,params)
data.heads = args.head
data.id = args.id
local pattern = args.pattern
args.real.label = "realis"
args.imp.label = "imperative"
args.dim.label = "diminutive"
args.caus.label = "causative"
args.freq.label = "frequentative"
args.real.accel = {form = "realis"}
args.imp.accel = {form = "imperative"}
if #args.real > 0 then table.insert(data.inflections, args.real) end
if #args.imp > 0 then table.insert(data.inflections, args.imp) end
if #args.dim > 0 then table.insert(data.inflections, args.dim) end
if #args.caus > 0 then table.insert(data.inflections, args.caus) end
if #args.freq > 0 then table.insert(data.inflections, args.freq) end
end
pos_functions = function(args, data)
params = {
= {alias_of = 'head'},
= {alias_of = 'sup'},
head = {list = true},
head2= {},
head3= {},
sup = {list = true},
caus = {list = true},
dim = {list = true}
}
local args = require("Module:parameters").process(args,params)
data.heads = args.head
data.id = args.id
local pattern = args.pattern
args.sup.label = "superlative"
args.caus.label = "causative"
args.dim.label = "diminutive"
args.sup.accel = {form = "superlative"}
if #args.sup > 0 then table.insert(data.inflections, args.sup) end
if #args.caus > 0 then table.insert(data.inflections, args.caus) end
if #args.dim > 0 then table.insert(data.inflections, args.dim) end
end
pos_functions = function(args, data)
params = {
= {alias_of = 'head'},
= {alias_of = 'pl'}, -- Special plural cases only
head = {list = true},
head2= {},
head3= {},
pl = {list =true},
dim = {list = true}
}
local args = require("Module:parameters").process(args,params)
data.heads = args.head
data.id = args.id
local pattern = args.pattern
args.pl.label = "plural"
args.dim.label = "diminutive"
args.pl.accel = {form = "plural"}
if #args.pl > 0 then table.insert(data.inflections, args.pl) end
if #args.dim > 0 then table.insert(data.inflections, args.dim) end
end
return export