45,647
edits
No edit summary |
No edit summary |
||
Line 36: | Line 36: | ||
end | end | ||
local | local first_rules = { | ||
{"n(·?)([kg])", "ŋ%1%2"}, {"ŋg", "ŋ"}, {"c", "ʧ"}, {"j", "ʤ"}, {"y", "j"}, {"g", "ɡ"}, | {"n(·?)([kg])", "ŋ%1%2"}, {"ŋg", "ŋ"}, {"c", "ʧ"}, {"j", "ʤ"}, {"y", "j"}, {"g", "ɡ"}, | ||
-- Long vowels | -- Long vowels | ||
Line 42: | Line 42: | ||
-- Diphthongs | -- Diphthongs | ||
{"(" .. vowels .. ")y", function(v) return laxen(v) .. "ɪ" end}, {"au", "aʊ"}, | {"(" .. vowels .. ")y", function(v) return laxen(v) .. "ɪ" end}, {"au", "aʊ"}, | ||
} | } | ||
Line 87: | Line 81: | ||
end | end | ||
function export. | function export.crux(term) | ||
term = mw.ustring.lower(term) | term = mw.ustring.lower(term) | ||
for _, rule in ipairs( | for _, rule in ipairs(first_rules) do | ||
term = gsub(term, rule[1], rule[2]) | term = gsub(term, rule[1], rule[2]) | ||
end | end | ||
Line 96: | Line 90: | ||
term = syllabify(term) | term = syllabify(term) | ||
for _, micrule in ipairs( | for _, micrule in ipairs(phonetic_rules) do | ||
term = gsub(term, micrule[1], micrule[2]) | term = gsub(term, micrule[1], micrule[2]) | ||
end | end | ||
term = gsub(term, "·", ".") | term = gsub(term, "·", ".") | ||
Line 133: | Line 108: | ||
local IPA_args = {} | local IPA_args = {} | ||
local phonetic = export.crux(term) | |||
local phonetic = export. | table.insert(IPA_args, {pron = '[' .. phonetic .. ']'}) | ||
return "* " .. m_IPA.format_IPA_full(lang, IPA_args) | return "* " .. m_IPA.format_IPA_full(lang, IPA_args) |