Module:pine-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 13: Line 13:


local laxen = {
local laxen = {
["y"] = "ʏ", ["i"] = "ɪ", ["ů"] = "œ", ["e"] = "ɛ",
["y"] = "ʏ", ["i"] = "ɪ", ["e"] = "ɛ",
["u"] = "ʊ", ["o"] = "ɔ", ["a"] = "ɑ",
["u"] = "ʊ", ["o"] = "ɔ", ["a"] = "ɑ",
}
}
Line 26: Line 26:
function export.crux(term)
function export.crux(term)
-- default to short lax vowels
-- default to short lax vowels
term = term:gsub("[aeiouyů]", laxen)
term = term:gsub("[aeiou]", laxen); term = term:gsub("ů", "œ")
-- long vowels
-- long vowels
term = term:gsub("[ảẻỉỏủỷ]", long_vowels)
local nfd_term = mw.ustring.toNFD(term)
term = term:gsub("ỷ", "yː")
nfd_term = nfd_term:gsub("[aeiouy]" .. c.hook, long_vowels)
term = mw.ustring.toNFC(nfd_term)
term = term:gsub("ɔɑ", "ɑː"); term = term:gsub("ɛœ", "øː")
term = term:gsub("ɔɑ", "ɑː"); term = term:gsub("ɛœ", "øː")
-- diphthongized vowels
-- diphthongized vowels