Module:xchc-noun: Difference between revisions
No edit summary |
No edit summary |
||
| Line 24: | Line 24: | ||
end | end | ||
local function gsubh(word, o, e, def) | local function gsubh(word, o, e, r, u, def) | ||
local backh = | local ipa = m_ipa.crux(word) | ||
local repl = {["ɛ"] = e, ["ɔ"] = o} | local backh = ipa:match("ɛ") and "ɛ" or ipa:match("ɔ") and "ɔ" or nil | ||
return word:gsub(" | local roundh = ipa:match("[yuɔo]") and "r" or ipa:match("[ie]") and "u" or nil | ||
local repl = {["ɛ"] = e, ["ɔ"] = o, ["r"] = r, ["u"] = u} | |||
return not r and word:gsub("B", repl[backh] or def) or word:gsub("R", repl[roundh] or def) | |||
end | end | ||
| Line 53: | Line 55: | ||
or wordpron(word):me("[ɛa]") and "н" | or wordpron(word):me("[ɛa]") and "н" | ||
or wordpron(word):me("[uoɔ]") and "ӈ" | or wordpron(word):me("[uoɔ]") and "ӈ" | ||
or gsubh(" | or gsubh("Bӈ","о̆","э̆",nil,nil,"о̆") | ||
data.pl = { | data.pl = { | ||
["i"] = wordpron(word):me(voiceless) and gsubh(" | ["i"] = wordpron(word):me(voiceless) and gsubh("фBд","ө","э",nil,nil,"э") or gsubh("вBд","ө","э",nil,nil,"э"), | ||
["a"] = wordpron(word):me(voiceless) and gsubh(" | ["a"] = wordpron(word):me(voiceless) and gsubh("шBд","о̆","э̆",nil,nil,"о̆") or gsubh("жBд","о̆","э̆",nil,nil,"о̆"), | ||
} | } | ||
| Line 106: | Line 108: | ||
local cases = {"nominative", "accusative", "dative", "genitive", "instrumental", "prosecutive", "adessive<br/>comitative", "ablative<br/>elative", "illative<br/>allative"} | local cases = {"nominative", "accusative", "dative", "genitive", "instrumental", "prosecutive", "adessive<br/>comitative", "ablative<br/>elative", "illative<br/>allative"} | ||
local numbers = {"singular", "paucal", "plural"} | local numbers = {"singular", "paucal", "plural"} | ||
local ret = {} | local ret = {} | ||
| Line 115: | Line 116: | ||
end | end | ||
for _, | for _, number in ipairs(numbers) do | ||
table.insert(ret, "! " .. | table.insert(ret, "! " .. number .. "\n") | ||
end | end | ||
table.insert(ret, "|-\n") | table.insert(ret, "|-\n") | ||
| Line 124: | Line 125: | ||
table.insert(ret, "|-\n") | table.insert(ret, "|-\n") | ||
for _, case in ipairs(cases) do | for _, case in ipairs(cases) do | ||
local c_sh = case:sub(1,3) | |||
for _, number in ipairs(numbers) do | |||
local n_sh = number:sub(1,3) | |||
local decl = { | |||
["nom"] = "", | |||
["acc"] = w_number[n_sh]:me(vowel) and "дза" or w_number[n_sh]:me(voiced) and "да" or "та", | |||
["dat"] = w_number[n_sh]:me(vowel) and "ша" or w_number[n_sh]:me(voiced) and "за" or "са", | |||
["gen"] = "ля", | |||
["ins"] = w_number[n_sh]:me(vowel) and "лза" or gsubh("Bлз","ө", "э", nil, nil, "ө"), | |||
["pro"] = gsubh("сBц","ө", "э", nil, nil, "ө"), | |||
["ade"] = "ляц", | |||
["abl"] = gsubh("сB",nil,nil,"u","i","u") .. gsubh("шR","о̄̆","э̄̆",nil,nil,"э̄̆"), | |||
["pro"] = gsubh("кFб","ү","ы",nil,nil,"ы"), | |||
} | |||
table.insert(ret, "| " .. show_form(w_number[n_sh] .. decl[c_sh])) | |||
end | |||
table.insert(ret, "\n") | |||
end | end | ||