Module:xchc-noun: Difference between revisions
No edit summary |
No edit summary |
||
| Line 26: | Line 26: | ||
end | end | ||
local function | local function gsubbh(word, data, def) | ||
local ipa = wordpron(word) | local ipa = wordpron(word) | ||
local backh = ipa:match("ɛ") and "ɛ" or ipa:match("ɔ") and "ɔ" or nil | local backh = ipa:match("ɛ") and "ɛ" or ipa:match("ɔ") and "ɔ" or nil | ||
local repl = {["ɛ"] = data.e, ["ɔ"] = data.o} | |||
return word:gsub("B", repl[backh or def]) | |||
end | |||
local function gsubrh(word, data, def) | |||
local ipa = wordpron(word) | |||
local roundh = ipa:match("[yuɔo]") and "r" or ipa:match("[ie]") and "u" or nil | local roundh = ipa:match("[yuɔo]") and "r" or ipa:match("[ie]") and "u" or nil | ||
local repl = { | local repl = {["r"] = data.r, ["u"] = data.u} | ||
return | return word:gsub("R", repl[roundh or def]) | ||
end | end | ||
local roundh = ipa:match("[yuɔo]") and "r" or ipa:match("[ie]") and "u" or nil | |||
function export.show(frame) | function export.show(frame) | ||
| Line 51: | Line 59: | ||
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 gsubbh("Bӈ",{["o"]="о̆",["e"]="э̆"},"o") | ||
data.pl = { | data.pl = { | ||
["i"] = wordpron(word):match(voiceless .. "ː?$") and | ["i"] = wordpron(word):match(voiceless .. "ː?$") and gsubbh("фBд",{["o"]="ө",["e"]="э"},"e") or gsubbh("вBд",{["o"]="ө",["e"]="э"},"e"), | ||
["a"] = wordpron(word):match(voiceless .. "ː?$") and | ["a"] = wordpron(word):match(voiceless .. "ː?$") and gsubbh("шBд",{["o"]="о̆",["e"]="э̆"},"o") or gsbubh("жBд",{["o"]="о̆",["e"]="э̆"},"o") | ||
} | } | ||
| Line 112: | Line 120: | ||
["dat"] = w_number[n_sh]:match(vowel .. "ː?$") and "ша" or w_number[n_sh]:match(voiced .. "ː?$") and "за" or "са", | ["dat"] = w_number[n_sh]:match(vowel .. "ː?$") and "ша" or w_number[n_sh]:match(voiced .. "ː?$") and "за" or "са", | ||
["gen"] = "ля", | ["gen"] = "ля", | ||
["ins"] = w_number[n_sh]:match(vowel .. "ː?$") and "лза" or | ["ins"] = w_number[n_sh]:match(vowel .. "ː?$") and "лза" or gsubbh("Bлз",{["o"]="ө",["e"]="э"},"o"), | ||
["pro"] = | ["pro"] = gsubbh("сBц","ө", "э", nil, nil, "ө"), | ||
["ade"] = "ляц", | ["ade"] = "ляц", | ||
["abl"] = | ["abl"] = gsubbh("сB",{["r"]="u",["u"]="i"},"r") .. gsubrh("шR",{["o"]="о̄̆",["e"]="э̄̆"},"e"), | ||
["ill"] = | ["ill"] = gsubrh("к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") | ||