45,646
edits
No edit summary |
No edit summary |
||
Line 27: | Line 27: | ||
end | end | ||
local function | local function gsubh(pat, repl, def) | ||
local | local word = data.word | ||
local | 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 | |||
end | if pat:match("B") and pat:match("R") then | ||
pat = pat:gsub("B", todef("backness")):gsub("R", todef("roundness")) | |||
else | |||
pat = pat:gsub(pat:match("[BR]"),todef(pat:match("[BR]") == "B" and "backness" or "roundness")) | |||
end | |||
return pat | |||
return | |||
end | end | ||
Line 58: | Line 58: | ||
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 | or gsubh("Bӈ",{["b"]="о̆",["f"]="э̆"},"b") | ||
data.pl = { | data.pl = { | ||
["i"] = (wordpron(word):match(voiceless .. "ː?$") and "ш" or "ж") .. | ["i"] = (wordpron(word):match(voiceless .. "ː?$") and "ш" or "ж") .. gsubh("Bд",{["b"]="о̆",["e"]="э̆"},"b"), | ||
["a"] = (wordpron(word):match(voiceless .. "ː?$") and "ф" or "в") .. | ["a"] = (wordpron(word):match(voiceless .. "ː?$") and "ф" or "в") .. gsubh("Rд",{["r"]="ө",["u"]="э"},"u"), | ||
} | } | ||
Line 119: | Line 119: | ||
["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 | ["ins"] = wordpron(w_number[n_sh]):match(vowel .. "ː?$") and "лза" or gsubh("Rлз",{["r"]="ө",["u"]="э"},"r"), | ||
["pro"] = | ["pro"] = gsubh("сRц",{["r"]="ө",["u"]="э"}, "r"), | ||
["ade"] = "ляц", | ["ade"] = "ляц", | ||
["abl"] = | ["abl"] = gsubh("сRшB",{["r"]="u",["u"]="i",["b"]="о̄̆",["f"]="э̄̆"},{["roundness"] = "r", ["backness"] = "f"}), | ||
["ill"] = | ["ill"] = gsubh("кRб",{["r"]="ү",["u"]="ы"},"u"), | ||
} | } | ||
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") |