Module:xchc-noun: Difference between revisions

Jump to navigation Jump to search
Undo revision 474001 by Sware (talk)
No edit summary
(Undo revision 474001 by Sware (talk))
Line 22: Line 22:
local voiceless = "пткфсшӀчц" --"ptkfsʃxh"
local voiceless = "пткфсшӀчц" --"ptkfsʃxh"
local consonant = "[" .. voiced .. voiceless .. "]"
local consonant = "[" .. voiced .. voiceless .. "]"
local vowel = "[" .. c.macron .. c.breve .. c.diaer .. "ыиэеаяүөуюоёӯӣ]" --"[aeɛioɔuyø]"
local vowel = "[ыиэеаяүөуюоёӯӣɜɔ]" --"[aeɛioɔuyø]"
local genders = {["a"] = "animate", ["i"] = "inanimate"}
local genders = {["a"] = "animate", ["i"] = "inanimate"}


Line 59: Line 59:
data.g = g
data.g = g
data.sg = ""
data.sg = ""
 
local pautable = {
local pautable = {
{"(э%W?%W)$", "н"}, {"([ая]%W?)$", "н"},
["[эеыиӣөү]"] = "ч",
{"([ою]%W?%W?)$", "ӈ"}, {"(е%W?%W)$", "ӈ"}, {"([уӯ])$", "ӈ"},
["[ɛая]"] = "н",
{"([эеыөү]%W?)$", "ч"}, {"([иӣ])$", "ч"},
["[уӯоɔ]"] = "ӈ",
}
}
local simplified_word = m_ipa.simplify(word)
--data.pau = nil
--data.pau = nil
if mw.ustring.toNFD(word):match(vowel .. "$") then
if simplified_word:match(vowel .. "$") then
for _, ms in ipairs(pautable) do
for pat, pau in pairs(pautable) do
if word:match(ms[1]) then
if simplified_word:match(pat .. "$") then
data.pau = ms[2]
data.pau = pau
break
break
end
end
Line 79: Line 80:
data.pl = {
data.pl = {
["i"] = (match(word, "[" .. voiceless .. "]" .. c.macron .. "?$") and "ш" or "ж") .. gsubh(word, "Bд",{["b"]="о̆",["e"]="э̆", ["ab"]="о̆"}),
["i"] = (match(simplified_word, "[" .. voiceless .. "]$") and "ш" or "ж") .. gsubh(word, "Bд",{["b"]="о̆",["e"]="э̆", ["ab"]="о̆"}),
["a"] = (match(word, "[" .. voiceless .. "]" .. c.macron .. "?$") and "ф" or "в") .. gsubh(word, "Rд",{["r"]="ө",["u"]="э", ["ar"]="э"}),
["a"] = (match(simplified_word, "[" .. voiceless .. "]$") and "ф" or "в") .. gsubh(word, "Rд",{["r"]="ө",["u"]="э", ["ar"]="э"}),
}
}
Line 135: Line 136:
local decl = {
local decl = {
["nom"] = "",
["nom"] = "",
["acc"] = match(pron(w_number[n_sh]), vowel .. "ː?$") and "дза"
["acc"] = match(w_number[n_sh], vowel .. "$") and "дза"
      or match(pron(w_number[n_sh]), voiced .. "ː?$") and "да"
      or match(w_number[n_sh], voiced .. "$") and "да"
      or "та",
      or "та",
["dat"] = match(pron(w_number[n_sh]), vowel .. "ː?$") and "ша"
["dat"] = match(w_number[n_sh], vowel .. "$") and "ша"
  or match(pron(w_number[n_sh]), voiced .. "ː?$") and "за"
  or match(w_number[n_sh], voiced .. "$") and "за"
  or "са",
  or "са",
["gen"] = "ля",
["gen"] = "ля",
["ins"] = match(pron(w_number[n_sh]), vowel .. "ː?$") and "лза"
["ins"] = match(w_number[n_sh], vowel .. "$") and "лза"
  or gsubh(w_number[n_sh], "Rлз",{["r"]="ө",["u"]="э",["ar"]="ө"}),
  or gsubh(w_number[n_sh], "Rлз",{["r"]="ө",["u"]="э",["ar"]="ө"}),
["pro"] = gsubh(w_number[n_sh], "сRц",{["r"]="ө",["u"]="э", ["ar"]="ө"}),
["pro"] = gsubh(w_number[n_sh], "сRц",{["r"]="ө",["u"]="э", ["ar"]="ө"}),

Navigation menu