Module:kilta-pron: Difference between revisions

No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 14: Line 14:
local m_IPA = require("Module:IPA")
local m_IPA = require("Module:IPA")


local consonants = "[pβmtsnɾlʧkxqhyʤɡbvd]"
local consonants = "[pβmtsnɾlʧkxqhyʤɡbvdƕ]"
local vowels = "[aeiouáéíóúəïüëæ]"
local vowels = "[aeiouáéíóúəïüëæ]"


Line 62: Line 62:


local sandhi_rules = {
local sandhi_rules = {
{"(" .. consonants .. ")u%sˈ?(" .. vowels .. ")", "%1w%2"},
{"(" .. consonants .. ")u%sˈ?(" .. vowels .. ")", "%1w%2"},
{"(" .. consonants .. ")i%sˈ?(" .. vowels .. ")", "%1j%2"},
{"(" .. consonants .. ")i%sˈ?(" .. vowels .. ")", "%1j%2"},
{"[mnŋ]%s(ˈ?[mpbβ])", "%1"}, {"[mnŋ]%s(ˈ?v)", "ɱ·%1"},
{"([mnŋ])(%sˈ?)βə", "%1%2bə"},
{"[mnŋ]%s(ˈ?[tdɾlsn])", "%1"}, {"[mnŋ]%s(ˈ?[ʧʤ])", "n̠·%1"},
{"[mnŋ]%s(ˈ?[mpbβ])", "m %1"}, {"[mnŋ]%s(ˈ?v)", "ɱ %1"},
{"[mnŋ]%s(ˈ?[ŋkɡqƕy])", "ŋ·%1"},
{"[mnŋ]%s(ˈ?[tdɾlsn])", "n %1"}, {"[mnŋ]%s(ˈ?[ʧʤ])", "%1"},
{"([mnŋ]) βə", "%1 "},
{"[mnŋ]%s(ˈ?[ŋkɡqƕy])", "ŋ %1"},
}
}


Line 139: Line 139:
end
end
return  
return phonemicAll, phoneticAll
end
end


Line 152: Line 152:
local phonemic, phonetic = separate_word(term)
local phonemic, phonetic = separate_word(term)
for _, rule in ipairs(sandhi_rules) do
local IPA_args = {{pron = '[' .. phonetic .. ']'}}
phonetic = gsub(phonetic, rule[1], rule[2])
end
local IPA_args = {{pron = '/' .. phonemic .. '/'}, {pron = '[' .. phonetic .. ']'}}
if phonemic ~= phonetic then table.insert(IPA_args, 1, {pron = '/' .. phonemic .. '/'}) end


return "* " .. m_IPA.format_IPA_full(lang, IPA_args)
return "* " .. m_IPA.format_IPA_full({lang = lang, items = IPA_args})
end
end


return export
return export