Module:etymology: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 156: Line 156:
     [1] = {required = true},
     [1] = {required = true},
     [2] = {list = true},
     [2] = {list = true},
    ["type"] = {},
     ["t"] = {list = true, allow_holes = true},
     ["t"] = {list = true, allow_holes = true},
     ["l"] = {list = true, allow_holes = true},
     ["l"] = {list = true, allow_holes = true},
Line 174: Line 175:
     ["-"] = true,
     ["-"] = true,
     ["·"] = true,
     ["·"] = true,
}
local affix_compound_data = {
["alliterative"] = {
categories = {"alliterative compounds"},
},
["antonymous"] = {
categories = {"antonymous compounds"},
},
["bahuvrihi"] = {
categories = {"bahuvrihi compounds"},
},
["coordinative"] = {
categories = {"coordinative compounds"},
},
["descriptive"] = {
categories = {"descriptive compounds"},
},
["determinative"] = {
categories = {"determinative compounds"},
},
["dvandva"] = {
categories = {"dvandva compounds"},
},
["endocentric"] = {
categories = {"endocentric compounds"},
},
["exocentric"] = {
categories = {"exocentric compounds"},
},
["karmadharaya"] = {
categories = {"karmadharaya compounds"},
},
["rhyming"] = {
categories = {"rhyming compounds"},
},
["synonymous"] = {
categories = {"synonymous compounds"},
},
["tatpurusa"] = {
categories = {"tatpurusa compounds"},
},
}
local affix_compound_aliases = {
allit = "alliterative",
ant = "antonymous",
bahu = "bahuvrihi",
bv = "bahuvrihi",
coord = "coordinative",
desc = "descriptive",
det = "determinative",
dva = "dvandva",
endo = "endocentric",
exo = "exocentric",
karma = "karmadharaya",
kd = "karmadharaya",
rhy = "rhyming",
syn = "synonymous",
tat = "tatpurusa",
tp = "tatpurusa",
}
}


Line 312: Line 372:
     if (not args["nocat"]) and (n_parts > 1 and n_affixes == 0) then
     if (not args["nocat"]) and (n_parts > 1 and n_affixes == 0) then
         table.insert(categories, language_to.name .. " compound terms")
         table.insert(categories, language_to.name .. " compound terms")
        if args["type"] then
        local affix_type = affix_compound_data[affix_compound_aliases[args["type"]] or args["type"]]
        if affix_type then
        for _, category in ipairs(affix_type["categories"]) do
        table.insert(categories, language_to.name .. " " .. category)
        end
        end
        end
     end
     end
     local out = table.concat(pre_out, " + ")
     local out = table.concat(pre_out, " + ")