Module:xchc-noun: Difference between revisions
No edit summary Tag: Reverted |
No edit summary |
||
| (16 intermediate revisions by the same user not shown) | |||
| Line 10: | Line 10: | ||
local m_tr = require('Module:xchc-translit') | local m_tr = require('Module:xchc-translit') | ||
local m_ipa = require('Module:xchc-pron') | local m_ipa = require('Module:xchc-pron') | ||
local c = require("Module:languages/data").chars | |||
local lang = require('Module:languages').getByCode("xchc") | local lang = require('Module:languages').getByCode("xchc") | ||
| Line 17: | Line 19: | ||
local export = {} | local export = {} | ||
local voiced = "mnɲŋbdɡvzʒɣlr" | local voiced = "мньӈбдгвзжғлрй" --"mnɲŋbdɡvzʒɣlr" | ||
local voiceless = "ptkfsʃxh" | local voiceless = "пткфсшӀчц" --"ptkfsʃxh" | ||
local consonant = "[" .. voiced .. voiceless .. "]" | local consonant = "[" .. voiced .. voiceless .. "]" | ||
local vowel = "[aeɛioɔuyø]" | local vowel = "[ыиэеаяүөуюоёӯӣɜɔ]" --"[aeɛioɔuyø]" | ||
local genders = {["a"] = "animate", ["i"] = "inanimate"} | local genders = {["a"] = "animate", ["i"] = "inanimate"} | ||
local function gsubh(word, pat, repl, def) | local function gsubh(word, pat, repl, def) | ||
| Line 56: | Line 54: | ||
data.g = g | data.g = g | ||
data.sg = "" | data.sg = "" | ||
local pautable = {[" | local pautable = { | ||
data.pau = | ["[эеыиӣөү]"] = "ч", | ||
["[ɛая]"] = "н", | |||
["[уӯоɔ]"] = "ӈ", | |||
} | |||
local simplified_word = m_ipa.simplify(word) | |||
--data.pau = nil | |||
if simplified_word:match(vowel .. "$") then | |||
for pat, pau in pairs(pautable) do | |||
if simplified_word:match(pat .. "$") then | |||
data.pau = pau | |||
break | |||
end | |||
end | |||
else | |||
data.pau = gsubh(word, "Bӈ",{["b"]="о̆",["f"]="э̆", ["ab"]="о̆"}) | |||
end | |||
data.pl = { | data.pl = { | ||
["i"] = (match( | ["i"] = (match(simplified_word, "[" .. voiceless .. "]$") and "ш" or "ж") .. gsubh(word, "Bд",{["b"]="о̆",["e"]="э̆", ["ab"]="о̆"}), | ||
["a"] = (match( | ["a"] = (match(simplified_word, "[" .. voiceless .. "]$") and "ф" or "в") .. gsubh(word, "Rд",{["r"]="ө",["u"]="э", ["ar"]="э"}), | ||
} | } | ||
| Line 91: | Line 106: | ||
end | end | ||
return | return '<span lang="xchc" class="Cyrl">' .. table.concat(ret, ", ") .. '</span><br/><span style="color: #888;">' .. table.concat(tr_ret, ", ") .. "</span>" | ||
end | end | ||
| Line 117: | Line 131: | ||
local decl = { | local decl = { | ||
["nom"] = "", | ["nom"] = "", | ||
["acc"] = match | ["acc"] = match(w_number[n_sh], vowel .. "$") and "дза" | ||
or match | or match(w_number[n_sh], voiced .. "$") and "да" | ||
or "та", | or "та", | ||
["dat"] = match | ["dat"] = match(w_number[n_sh], vowel .. "$") and "ша" | ||
or match | or match(w_number[n_sh], voiced .. "$") and "за" | ||
or "са", | or "са", | ||
["gen"] = "ля", | ["gen"] = "ля", | ||
["ins"] = match | ["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"]="ө"}), | ||