Module:User:iwsfutcmd/gez-nominal

Hello, you have come here looking for the meaning of the word Module:User:iwsfutcmd/gez-nominal. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:iwsfutcmd/gez-nominal, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:iwsfutcmd/gez-nominal in singular and plural. Everything you need to know about the word Module:User:iwsfutcmd/gez-nominal you have here. The definition of the word Module:User:iwsfutcmd/gez-nominal will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:iwsfutcmd/gez-nominal, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local sub = mw.ustring.sub
local com = require('Module:Ethi-common')

local export = {}

local function with_suffix(base, final_components, suffix)
    return sub(base, 1, -2) .. com.from_components(final_components) .. (suffix or '')
end

local function accusative_or_construct_form(base)
    local c = com.to_components(sub(base, -1))
    if c.order == 4 or c.order == 5 or c.order == 7 then
        return base
    elseif c.order == 2 then
        c.order = 7
    elseif c.order == 3 then
        c.order = 5
    else
        c.order = 1
    end
    return with_suffix(base, c)
end

local pronoun_suffixes = {
     = "የ",
     = "ከ",
     = "ኪ",
     = "ሁ",
     = "ሃ",
     = "ነ",
     = "ክሙ",
     = "ክን",
     = "ሆሙ",
     = "ሆን"
}

function export.external_plural(base, gender)
    local c = com.to_components(sub(base, -1))
    c.order = 4
    if gender == "m" then
        return with_suffix(base, c, "ን")
    elseif gender == "f" then
        return with_suffix(base, c, "ት")
    end
end

function export.with_pronominal_suffix(base, pronoun, base_is_plural, accusative)
    local output = {}
    local c = com.to_components(sub(base, -1))
    local suffix = pronoun_suffixes
    if c.order == 3 and sub(pronoun, 1, 1) == "2" and accusative then
        c.order = 5
    end
    if base_is_plural then
        if pronoun == "1s" then
            c.order = 6
        elseif pronoun == "2fs" then
            c.order = 6
            table.insert(output, with_suffix(base, c, suffix))
            c.order = 3
        else
            c.order = 3
        end
    else
        if c.order == 1 or c.order == 6 then
            if accusative and pronoun ~= "1s" then
                c.order = 1
            else
                c.order = 6
            end
            if pronoun == "3ms" then
                if accusative then
                    c.order = 7
                else
                    c.order = 2
                end
                suffix = ""
            elseif pronoun == "3fs" then
                c.order = 4
                suffix = ""
            elseif pronoun == "3mp" then
                c.order = 7
                suffix = "ሙ"
            elseif pronoun == "3fp" then
                c.order = 7
                suffix = "ን"
            end
        end
    end
    table.insert(output, with_suffix(base, c, suffix))
    return output
end

function export.construct_form(base)
    return accusative_or_construct_form(base)
end

function export.accusative_form(base, personal_name)
    return accusative_or_construct_form(base)
end

return export