Module:rad-stem: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
m (Added ħ stems)
No edit summary
Line 252: Line 252:
end
end


function export.getNounStem(args) -- rad-inflection|pos|principle_part| 3 | 4 | 5
function export.getNounStem(args) -- rad-inflection|pos|principle_part| 3 | 4 | 5, outputs table of principle parts
local principle_parts = {
local principle_parts = {
["nom"] = "",
["nom"] = "",
Line 450: Line 450:
end
end


--[[
function export.getVerbStem(args)


function export.getVerbStem(args) -- outputs table of principle parts
local principle_parts = {
["inf"] = args[1],
["2s"] = args[2],
["pst"] = args[3],
["prespart"] = args[4],
["pspart"] = args[5],
["vnoun"] = args[6] or (args[5] .. "aș")
}
-- non-finite parameters
principle_parts["nonfin"] = mw.ustring.gsub(principle_parts["inf"], "ut$", "ût")
if mw.ustring.gmatch(principle_parts["pspart"], "ru$") then
principle_parts["pspart"] = mw.ustring.gsub(principle_parts["pspart"], "ru$", "rủ")
principle_parts["pspart_broken"] = mw.ustring.gsub(principle_parts["pspart"], "rủ$", "rủo")
else
principle_parts["pspart"] = principle_parts["pspart"] .. "ú"
principle_parts["pspart_broken"] = mw.ustring.gsub(principle_parts["pspart"], "ú$", "uo")
end
-- nonpast parameters
principle_parts["1s"] = args["1s"] or (principle_parts["2s"] .. "e")
principle_parts["3s"] = args["3s"] or (principle_parts["2s"] .. "ș")
principle_parts["pl"] = args["pl"] or (principle_parts["2s"])
principle_parts["a"] = args["a"] or mw.ustring.gsub(principle_parts["2s"] .. "a", "([eoø])a$", "%1à")
principle_parts["aa"] = args["aa"] or mw.ustring.gsub(principle_parts["2s"] .. "á", "([^eoø])avá$", "%1áva")
principle_parts["ai"] = args["ai"] or mw.ustring.gsub(principle_parts["2s"] .. "ai", "([^eoø])avai$", "%1áe")
principle_parts["depers"] = args["depers"] or principle_parts["2s"]
principle_parts["o"] = mw.ustring.gsub(principle_parts["2s"] .. "o", "([au])o$", "%1ò")
principle_parts["imp"] = args["imp"] or principle_parts["a"]
principle_parts["r"] = args["r"] or principle_parts["2s"] .. "r"
principle_parts["r"] = mw.ustring.gsub(principle_parts["r"], "vr$", "r")
principle_parts["r"] = mw.ustring.gsub(principle_parts["r"], "([sș])r$", "%1tr")
principle_parts["r"] = mw.ustring.gsub(principle_parts["r"], "([zx])r$", "%1dr")
principle_parts["r"] = mw.ustring.gsub(principle_parts["r"], "nr$", "rr")
principle_parts["r"] = mw.ustring.gsub(principle_parts["r"], "mr$", "mbr")
principle_parts["r"] = mw.ustring.gsub(principle_parts["r"], "ņr$", "ņgr")
-- past parameters
principle_parts["apst"] = args["apst"] or mw.ustring.gsub(principle_parts["pst"] .. "a", "([eoø])a$", "%1à")
principle_parts["aipst"] = args["aipst"] or (principle_parts["pst"] .. "ai")
principle_parts["epst"] = args["epst"] or principle_parts["pst"]
principle_parts["rpst"] = args["rpst"] or (principle_parts["pst"] .. "r")
principle_parts["rpst"] = mw.ustring.gsub(principle_parts["rpst"], "vr$", "r")
principle_parts["rpst"] = mw.ustring.gsub(principle_parts["rpst"], "([sș])r$", "%1tr")
principle_parts["rpst"] = mw.ustring.gsub(principle_parts["rpst"], "([zx])r$", "%1dr")
principle_parts["rpst"] = mw.ustring.gsub(principle_parts["rpst"], "nr$", "rr")
principle_parts["rpst"] = mw.ustring.gsub(principle_parts["rpst"], "mr$", "mbr")
principle_parts["rpst"] = mw.ustring.gsub(principle_parts["rpst"], "ņr$", "ņgr")
principle_parts["upst"] = args["pst"] or mw.ustring.gsub(principle_parts["pst"] .. "ú", "[uú]ú$", "ủ")
principle_parts["upst_broken"] = args["pst"] or mw.ustring.gsub(principle_parts["pst"] .. "uo", "[uú]uo$", "ủo")
return principle_parts
end
end
]]--


function export.getStem(frame)
function export.getStem(frame)

Navigation menu