5 515
contributi
Modifiche
nessun oggetto della modifica
function export.to_phonemic(word, voiced_z, single_character_affricates)
word = mw.ustring.lower(word)
if mw.ustring.find(word,"sč") then local decomposed = mw.ustring.toNFC(word) --sč at the end of a word is /ʃ/ decomposed = decomposed :gsub("sč","ʃ") end
-- Decompose combining characters: for instance, è → e + ◌̀
local decomposed = mw.ustring.toNFD(word)
-- This does not handle phrases containing more than one stressed word.
-- Default to penultimate stress rather than throw error?
if not mw.ustring.find(decomposed, acute_or_grave) then
-- Allow monosyllabic unstressed words.
local vowel_count = select(2, decomposed:gsub("[aeiou]", "%1"))
return ({ e = "ɛ", o = "ɔ" })[vowel] .. accent
end) -- e or o followed by grave
-- ci, gi + vowel
-- Do ci, gi + e, é, è sometimes contain /j/?