Jump to content

Module:az-infl

From Wiktionary, the free dictionary


local export = {}

local endsIn = require("Module:az-common").endsIn
local getHarmonicalVowel = require("Module:az-common").getHarmonicalVowel

--[=[
This function accepts a key/value table and applies the full_link() function from [[Module:links]] to the values.
Used to automatically generate link-containing wikitables based on raw inflection data.
--]=]
local function link(tab) for k, v in pairs(tab) do local cell = {} for kk, vv in pairs(mw.text.split(v, ', ')) do table.insert(cell, require("Module:links").full_link({ term = vv, lang = require("Module:languages").getByCode("az") })) end tab[k] = table.concat(cell, ', ') end return tab end

--[=[
This function generates all the necessary declension for nominal words: the casal declensions and the possessive forms for nouns, adjectives, participle and infinitive forms of verbs, some pronouns, some numbers, and some adverbs.
]=]
local function decline(term, casal_stem, possessive_stem)
    local function make_plural() return term .. "l" .. getHarmonicalVowel(term, "open") .. "r" end
    local function decline_genitive() return end
    local function decline_dative() return end
    local function decline_accusative() return end
    local function decline_locative() return end
    local function decline_ablative() return end

    return {
        ["nom|sg"] = term,
        ["nom|pl"] = make_plural(term),
        ["def|gen|sg"] = decline_genitive(term),
        ["def|gen|pl"] = decline_genitive(make_plural(term)),
        ["dat|sg"] = decline_dative(term),
        ["dat|pl"] = decline_dative(make_plural(term)),
        ["def|acc|sg"] = decline_accusative(term),
        ["def|acc|pl"] = decline_accusative(make_plural(term)),
        ["loc|sg"] = decline_locative(term),
        ["loc|pl"] = decline_locative(make_plural(term)),
        ["abl|sg"] = decline_ablative(term),
        ["abl|pl"] = decline_ablative(make_plural(term))
    }
end

--[=[
This is the main function that will be invoked by {{az-infl}}.
]=]
function export.show(frame)
	
end

return export