Module:xchc-pron: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 15: Line 15:
local m_IPA = require("Module:IPA")
local m_IPA = require("Module:IPA")


local consonants = "[mnŋɲptbdkɡfvszʃʒxɣhʧʦʤʣlrɾʎ]"
local nb_cons = "mnŋɲptbdkɡfvszʃʒxɣhʧʦʤʣlrɾʎ"
local consonants = "[" .. nb_cons .. "]"


local export = {}
local export = {}
Line 85: Line 86:
{"ʦ", "t͡s"},
{"ʦ", "t͡s"},
{"ʧ", "t͡ʃ"},
{"ʧ", "t͡ʃ"},
}
local wnc = "([iyueøoɛɔœʌ]ː?)"
local western_rules = {
    {wnc .. "f$", "%1p̪͡f"},
    {wnc .. "v$", "%1b̪͡v"},
{wnc .. "s$", "%1t͡s"},
    {wnc .. "z$", "%1d͡z"},
    {wnc .. "ʃ$", "%1t͡ʃ"},
    {wnc .. "ʒ$", "%1d͡ʒ"},
    {wnc .. "x$", "%1k͡x"},
    {wnc .. "ɣ$", "%1ɡ͡ɣ"},
    {wnc .. "h$", "%1ʔ͡h"},
    {wnc .. "p$", "%1ɸ"}, {wnc .. "b$", "%1β"}, {wnc .. "t$", "%1s"},
    {wnc .. "d$", "%1z"}, {wnc .. "k$", "%1x"}, {wnc .. "ɡ$", "%1ɣ"},
}
local surgut_rules = {
{"ɲ", "nʲ"}, {"ʎ", "lʲ"},
{"(" .. consonants .. ")([iyeø])", "%1ʲ%2"},
}
}


Line 137: Line 158:
local phonetic = separate_word(term)
local phonetic = separate_word(term)
table.insert(IPA_args, {pron = '[' .. phonetic .. ']'})
table.insert(IPA_args, {pron = '[' .. phonetic .. ']'})
local western = phonetic
for _, rule in ipairs(western_rules) do
western = gsub(western, rule[1], rule[2])
end
local ipa1 = (western ~= phonetic) and "\n** " .. format_IPA_multiple(lang, {pron=western, q="Western"}) or ""
local surgut = phonetic
for _, rule in ipairs(surgut_rules) do
surgut = gsub(surgut, rule[1], rule[2])
end
local ipa2 = (surgut ~= phonetic) and "\n** " .. format_IPA_multiple(lang, {pron=surgut, q="Surgut"}) or ""


return "* " .. m_IPA.format_IPA_full(lang, IPA_args)
return "* " .. m_IPA.format_IPA_full(lang, IPA_args) .. ipa1 .. ipa2
end
end


return export
return export

Navigation menu