Jump to content

Module:MiddleAirananwe

From Yezur Wiki
Revision as of 08:21, 20 August 2026 by Thiorosan (talk | contribs) (A word-final -e is discarded before the dative singular -i: ghale > ghali (operator))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation for Module:MiddleAirananwe, the noun declension generator for Middle Airananwe (YAR-AI) on the Yezur wiki. It is not called directly: Template:YAR-AI-decl invokes it as {{#invoke:MiddleAirananwe|decl}}, and Dictionary entries transclude that template under their ====Declension==== heading. The module builds the endings from the spelling of the headword alone; it does not call Module:Auphen, and Module:Auphen/YAR-AI accordingly carries pronunciation data only, its sets table of named rulesets being empty.

Middle Airananwe has a single declension, so there is no class parameter. Four cases are generated in two numbers; the language has no gender and no vocative.

Parameters

Arguments are read from the transcluding template, so these are parameters of Template:YAR-AI-decl rather than of the invocation.

Parameter Purpose
word The headword to decline. Defaults to the page title without its namespace prefix, which is the usual case in Dictionary entries.
1 An unnamed alternative to word, used when word is absent.

Ordinary use in an entry is therefore {{YAR-AI-decl}}; {{YAR-AI-decl|word=abhoone}} overrides the title, for entries whose page name is not the citation form and for showing the table away from an entry.

Endings

The ending attaches to the bare lexeme. Where two forms are given below, the first follows a vowel and the second a consonant, the -e- being a linking vowel; the dative singular takes -i in both environments. The vowels recognised are a e i o u and their macron forms, in lower case.

Case Singular Plural
NOM -r / -er
GEN -n / -en -rn / -ern
DAT -i -ri / -eri
ACC -s / -es -rs / -ers

A word-final -e is discarded before the dative singular -i, and there only: abhoone gives dative singular abhooni but dative plural abhooneri. Only the one letter is removed, so arree gives arrei.

The output is a wikitable with the columns SG and PL and the case names down the side, the forms set in bold and the cell text centred.


-- Module:MiddleAirananwe — noun declension for Middle Airananwe (YAR-AI).
-- Backs Template:YAR-AI-decl. One class: the ending attaches to the bare
-- lexeme, taking a linking -e- after a consonant. Four cases, two numbers;
-- there is no gender and no vocative. A word-final -e drops before the
-- dative singular -i (ghale -> ghali).
local p = {}
local U = mw.ustring

local VOWEL = "[aeiouāēīōū]"

-- {case, ending after a vowel, ending after a consonant}
local ROWS = {
  {"NOM", "",   "",    "r",  "er"},
  {"GEN", "n",  "en",  "rn", "ern"},
  {"DAT", "i",  "i",   "ri", "eri"},
  {"ACC", "s",  "es",  "rs", "ers"},
}

function p.decl(frame)
  local a = frame:getParent().args
  local w = mw.text.trim(a.word or a[1] or "")
  if w == "" then w = mw.title.getCurrentTitle().text end
  local vowel = U.find(w, VOWEL .. "$") ~= nil
  local out = { '{| class="wikitable" style="text-align:center"', '! !! SG !! PL' }
  -- a word-final -e is discarded before the dative singular -i
  local dat_stem = U.gsub(w, "e$", "")
  for _, r in ipairs(ROWS) do
    local base = (r[1] == "DAT") and dat_stem or w
    local sg = base .. (vowel and r[2] or r[3])
    local pl = w .. (vowel and r[4] or r[5])
    table.insert(out, "|-")
    table.insert(out, "! " .. r[1])
    table.insert(out, "| '''" .. sg .. "''' || '''" .. pl .. "'''")
  end
  table.insert(out, "|}")
  return table.concat(out, "\n")
end

return p