Module:xchc-noun: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 30: Line 30:
local word = data.word
local word = data.word
local harmony = m_ipa.harmony(word)
local harmony = m_ipa.harmony(word)
local function todef(feat) return repl[harmony[feat]] or (type(def) == table and def[harmony[feat]] or repl[def]) end
if pat:match("B") and pat:match("R") then
if pat:match("B") and pat:match("R") then
pat = pat:gsub("B", todef("backness")):gsub("R", todef("roundness"))
pat = pat:gsub("B", repl[harmony.backness]):gsub("R", repl[harmony.roundness])
else
else
pat = pat:gsub("([BR])",function(s) return todef(s == "B" and "backness" or "roundness") end)
pat = pat:gsub("([BR])",function(s) return repl[harmony[s == "B" and "backness" or "roundness"]] end)
end
end


Line 58: Line 57:
  or wordpron(word):match("[ɛa]ː?$") and "н"
  or wordpron(word):match("[ɛa]ː?$") and "н"
  or wordpron(word):match("[uoɔ]ː?$") and "ӈ"
  or wordpron(word):match("[uoɔ]ː?$") and "ӈ"
  or gsubh("Bӈ",{["b"]="о̆",["f"]="э̆"},"b")
  or gsubh("Bӈ",{["b"]="о̆",["f"]="э̆", ["ab"]="о̆"})
data.pl = {
data.pl = {
["i"] = (wordpron(word):match(voiceless .. "ː?$") and "ш" or "ж") .. gsubh("Bд",{["b"]="о̆",["e"]="э̆"},"b"),
["i"] = (wordpron(word):match(voiceless .. "ː?$") and "ш" or "ж") .. gsubh("Bд",{["b"]="о̆",["e"]="э̆", ["ab"]="о̆"}),
["a"] = (wordpron(word):match(voiceless .. "ː?$") and "ф" or "в") .. gsubh("Rд",{["r"]="ө",["u"]="э"},"u"),
["a"] = (wordpron(word):match(voiceless .. "ː?$") and "ф" or "в") .. gsubh("Rд",{["r"]="ө",["u"]="э", ["ar"]="э"}),
}
}
Line 119: Line 118:
["dat"] = wordpron(w_number[n_sh]):match(vowel .. "ː?$") and "ша" or wordpron(w_number[n_sh]):match(voiced .. "ː?$") and "за" or "са",
["dat"] = wordpron(w_number[n_sh]):match(vowel .. "ː?$") and "ша" or wordpron(w_number[n_sh]):match(voiced .. "ː?$") and "за" or "са",
["gen"] = "ля",
["gen"] = "ля",
["ins"] = wordpron(w_number[n_sh]):match(vowel .. "ː?$") and "лза" or gsubh("Rлз",{["r"]="ө",["u"]="э"},"r"),
["ins"] = wordpron(w_number[n_sh]):match(vowel .. "ː?$") and "лза" or gsubh("Rлз",{["r"]="ө",["u"]="э",["ar"]="ө"}),
["pro"] = gsubh("сRц",{["r"]="ө",["u"]="э"}, "r"),
["pro"] = gsubh("сRц",{["r"]="ө",["u"]="э", ["ar"]="ө"}),
["ade"] = "ляц",
["ade"] = "ляц",
["abl"] = gsubh("сRшB",{["r"]="u",["u"]="i",["b"]="о̄̆",["f"]="э̄̆"},{["roundness"] = "r", ["backness"] = "f"}),
["abl"] = gsubh("сRшB",{["r"]="ү",["u"]="ы",["b"]="о̄̆",["f"]="э̄̆",["ar"]="у",["ab"]="э̄̆"}),
["ill"] = gsubh("кRб",{["r"]="ү",["u"]="ы"},"u"),
["ill"] = gsubh("кRб",{["r"]="ү",["u"]="ы",["ar"]="ы"}),
}
}
table.insert(ret, "| " .. show_form(w_number[n_sh] .. decl[c_sh]) .. "\n")
table.insert(ret, "| " .. show_form(w_number[n_sh] .. decl[c_sh]) .. "\n")

Navigation menu