Wiktionary
omwiktionary
https://om.wiktionary.org/wiki/Fuula_Dura
MediaWiki 1.47.0-wmf.8
case-sensitive
Media
Special
Talk
User
User talk
Wiktionary
Wiktionary talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
TimedText
TimedText talk
Module
Module talk
Event
Event talk
Module:om-noun
828
26650
81944
81943
2026-06-27T12:08:38Z
EyobAbebe7
3540
81944
Scribunto
text/plain
local export = {}
-- ---------------- UTILITIES ----------------
local function is_vowel(c)
if not c or c == "" then return false end
local vowels = {a=true, e=true, i=true, o=true, u=true}
return vowels[mw.ustring.lower(c)] or false
end
local function is_consonant(c)
if not c or c == "" then return false end
return not is_vowel(c) and mw.ustring.match(mw.ustring.lower(c), "[a-z]")
end
local function ends_with_double_vowel(w)
local last2 = mw.ustring.sub(w, -2)
return last2 == "aa" or last2 == "ee" or last2 == "ii" or last2 == "oo" or last2 == "uu"
end
-- ===================================================
-- ABSOLUTIVE & ACCUSATIVE (SINGULAR)
-- ===================================================
local function make_absolutive_singular(word)
return mw.ustring.lower(word)
end
local function make_accusative(word)
return mw.ustring.lower(word)
end
-- ===================================================
-- GENITIVE (SINGULAR)
-- ===================================================
local function make_genitive(word)
local w = mw.ustring.lower(word)
local last_char = mw.ustring.sub(w, -1)
if ends_with_double_vowel(w) then
return w
end
if is_vowel(last_char) then
return w .. last_char
end
return w
end
-- ===================================================
-- GENITIVE + FOCUS (SIRREEFFAME)
-- ===================================================
local function make_genitive_focus(word)
local w = mw.ustring.lower(word)
-- Asirratti jalqaba Genitive isaa baasa, sana booda "tu" itti dabala
local genitive_form = make_genitive(w)
return genitive_form .. "tu"
end
-- ===================================================
-- NOMINATIVE (SINGULAR) RULES
-- ===================================================
local function nominative_da_rule(w)
if mw.ustring.match(w, "da$") then
local base = mw.ustring.sub(w, 1, -3)
local base_last = mw.ustring.sub(base, -1)
if is_vowel(base_last) then
return base .. "nni"
end
end
return w
end
local function nominative_vra_vla_fa(w)
if mw.ustring.match(w, "ra$") then
local base = mw.ustring.sub(w, 1, -3)
if is_vowel(mw.ustring.sub(base, -1)) then return base .. "rri" end
elseif mw.ustring.match(w, "la$") then
local base = mw.ustring.sub(w, 1, -3)
if is_vowel(mw.ustring.sub(base, -1)) then return base .. "lli" end
elseif mw.ustring.match(w, "fa$") then
local base = mw.ustring.sub(w, 1, -3)
if is_vowel(mw.ustring.sub(base, -1)) then return base .. "fti" end
end
return w
end
local function nominative_vcv(w)
local n = mw.ustring.len(w)
if n < 3 then return w end
local v1 = mw.ustring.sub(w, -3, -3)
local c = mw.ustring.sub(w, -2, -2)
local v2 = mw.ustring.sub(w, -1, -1)
if is_vowel(v1) and is_consonant(c) and is_vowel(v2) then
return mw.ustring.sub(w, 1, -2) .. "ni"
end
return w
end
local function nominative_ccv(w)
local n = mw.ustring.len(w)
if n < 3 then return w end
local c1 = mw.ustring.sub(w, -3, -3)
local c2 = mw.ustring.sub(w, -2, -2)
local v = mw.ustring.sub(w, -1, -1)
if is_consonant(c1) and is_consonant(c2) and is_vowel(v) then
return mw.ustring.sub(w, 1, -2) .. "i"
end
return w
end
local function nominative_vv(w)
if ends_with_double_vowel(w) then
return w .. "n"
end
return w
end
local function make_nominative_singular(word)
local w = mw.ustring.lower(word)
-- Consonant End
if is_consonant(mw.ustring.sub(w, -1)) then return w end
-- yyo rule
if mw.ustring.match(w, "yyo$") then return w end
w = nominative_da_rule(w)
w = nominative_vra_vla_fa(w)
w = nominative_vcv(w)
w = nominative_ccv(w)
w = nominative_vv(w)
return w
end
-- ===================================================
-- INSTRUMENTAL (SIMPLE)
-- ===================================================
local function make_instrumental(word)
local w = mw.ustring.lower(word)
local last = mw.ustring.sub(w, -1)
if ends_with_double_vowel(w) then
return w .. "dhaan"
end
if is_vowel(last) then
return w .. last .. "n"
end
return w
end
-- ===================================================
-- NOMINATIVE + FOCUS
-- ===================================================
local function make_nominative_focus(word)
local w = mw.ustring.lower(word)
return w .. "tu"
end
-- ===================================================
-- INSTRUMENTAL (EXTENDED)
-- ===================================================
local function make_instrumental_extended(word)
local w = mw.ustring.lower(word)
if mw.ustring.len(w) == 0 then return w end
local last = mw.ustring.sub(w, -1)
if mw.ustring.match(w, "tiin$") then return w end
if ends_with_double_vowel(w) then
return w .. "tiin"
end
if is_vowel(last) then
return w .. last .. "tiin"
end
return w .. "iin"
end
-- ===================================================
-- DATIVE (SINGULAR)
-- ===================================================
local function make_dative(word)
local w = mw.ustring.lower(word)
local last = mw.ustring.sub(w, -1)
if ends_with_double_vowel(w) then
return w .. "f"
end
if is_vowel(last) then
return w .. last .. "f"
end
return w .. "iif"
end
-- ===================================================
-- DATIVE (EXTENDED)
-- ===================================================
local function make_dative_extended(word)
local w = mw.ustring.lower(word)
if mw.ustring.len(w) == 0 then return w end
local last = mw.ustring.sub(w, -1)
if ends_with_double_vowel(w) then
return w .. "tiif"
end
if is_vowel(last) then
return w .. last .. "tiif"
end
return w .. "itiif"
end
-- ===================================================
-- ALLATIVE
-- ===================================================
local function make_allative(word)
local w = mw.ustring.lower(word)
if mw.ustring.len(w) == 0 then return w end
local last = mw.ustring.sub(w, -1)
if is_vowel(last) then
return w .. "tti"
end
return w .. "itti"
end
-- ===================================================
-- GENITIVE-ALLATIVE
-- ===================================================
local function make_genitive_allative(word)
local w = mw.ustring.lower(word)
if mw.ustring.len(w) == 0 then return w end
local last = mw.ustring.sub(w, -1)
if ends_with_double_vowel(w) then
return w .. "tti"
end
if is_vowel(last) then
return w .. last .. "tti"
end
return w .. "iitti"
end
-- ===================================================
-- VOCATIVE
-- ===================================================
local function make_vocative(word)
local w = mw.ustring.lower(word)
return "yaa " .. make_genitive(w)
end
-- ===================================================
-- EXPORT FUNCTION (TEMPLATE ENTRY POINT)
-- ===================================================
function export.generate(frame)
local args = frame.args
if not args[1] and not args.word then
args = frame:getParent().args
end
local word = args[1] or args.word
-- Yoo parameter'n hin kennamne, maqaa fuulaa irraa fudhata
if not word or word == "" then
local pagename = mw.title.getCurrentTitle().text
if mw.title.getCurrentTitle().namespace == 10 or mw.title.getCurrentTitle().namespace == 828 then
word = "farda"
else
word = pagename
end
end
word = mw.text.trim(word)
if word == "" then return "" end
-- Generate Forms
local forms = {
abs = make_absolutive_singular(word),
nom = make_nominative_singular(word),
nomFocus = make_nominative_focus(word),
acc = make_accusative(word),
gen = make_genitive(word),
genFocus = make_genitive_focus(word), -- Asirratti sirreeffameera
ins = make_instrumental(word),
insExt = make_instrumental_extended(word),
dat = make_dative(word),
datExt = make_dative_extended(word),
all = make_allative(word),
genAll = make_genitive_allative(word),
vocat = make_vocative(word)
}
-- HTML Gabatee Uumuu
local html = mw.html.create('table')
:attr('border', '1')
:attr('cellpadding', '6')
:attr('cellspacing', '0')
:attr('style', 'border-collapse: collapse; text-align: left;')
-- Mata Duree
:tag('tr')
:tag('th'):attr('colspan', '2'):attr('style', 'background-color: #f2f2f2; text-align: center;'):wikitext('Maqaa (Noun Declensions) - [[' .. word .. ']]'):done()
:done()
-- Rows
:tag('tr'):tag('th'):wikitext('Absolutive'):done():tag('td'):wikitext('[[' .. forms.abs .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Accusative'):done():tag('td'):wikitext('[[' .. forms.acc .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Nominative'):done():tag('td'):wikitext('[[' .. forms.nom .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Nominative (Focus)'):done():tag('td'):wikitext('[[' .. forms.nomFocus .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Genitive'):done():tag('td'):wikitext('[[' .. forms.gen .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Genitive (Focus)'):done():tag('td'):wikitext('[[' .. forms.genFocus .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Dative'):done():tag('td'):wikitext('[[' .. forms.dat .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Dative (Extended)'):done():tag('td'):wikitext('[[' .. forms.datExt .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Instrumental'):done():tag('td'):wikitext('[[' .. forms.ins .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Instrumental (Extended)'):done():tag('td'):wikitext('[[' .. forms.insExt .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Allative'):done():tag('td'):wikitext('[[' .. forms.all .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Genitive-Allative'):done():tag('td'):wikitext('[[' .. forms.genAll .. ']]'):done():done()
:tag('tr'):tag('th'):wikitext('Vocative'):done():tag('td'):wikitext(forms.vocat):done():done()
return tostring(html)
end
return export
q7vzd04df5p84ej5pnwkoff3npvp17x