local export = {}
local pos_functions = {}
local lang = require("Module:languages").getByCode("ky")
local force_cat = false
local insert = table.insert
local function otherscript(inflections, args)
local title = mw.title.getCurrentTitle()
local sc = lang:findBestScript(title.subpageText)
local other_sc
if sc:getCode() == "Cyrl" then
local title = mw.title.getCurrentTitle()
local sc = lang:findBestScript(title.subpageText)
if sc:getCode() == "Cyrl" then
local inflection = { label = "Arabic spelling" }
if not tr then
tr = require("Module:ky-Cyrl-Arab-translit").tr(
require("Module:links").remove_links(
mw.title.getCurrentTitle().text), "ky", sc:getCode())
end
insert(inflection, { term = tr })
insert(inflections, inflection)
end
end
end
-- The main entry point.
function export.show(frame)
local poscat = frame.args or
error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
local parargs = frame:getParent().args
local params = {
= { list = true, disallow_holes = true },
= { list = true, allow_holes = true },
= {},
= { type = "boolean" },
= { type = "boolean" },
= {}, -- for testing
}
if pos_functions then
for key, val in pairs(pos_functions.params) do
params = val
end
end
local args = require("Module:parameters").process(parargs, params)
local pagename = args.pagename or mw.loadData("Module:headword/data").pagename
local data = {
lang = lang,
pos_category = poscat,
categories = {},
heads = {},
genders = {},
inflections = { enable_auto_translit = false },
pagename = pagename,
id = args.id,
sort_key = args.sort,
force_cat_output = force_cat,
}
local heads = args.head
for i = 1, #heads do
insert(data.heads, {
term = heads,
tr = args.tr,
})
end
otherscript(data.inflections, args)
if pos_functions then
pos_functions.func(args, data)
end
if args.json then
return require("Module:JSON").toJSON(data)
end
return require("Module:headword").full_headword(data)
end
return export