5 753
contributi
Modifiche
nessun oggetto della modifica
local long = "ː"
local acute_or_grave = "[" .. mw.ustring.char(0x300, 0x301) .. "]"
local vowels = "aeɛioɔuæaeɛioɔu"
local vowel = "[" .. vowels .. "]"
local not_vowel = "[^" .. vowels .. "]"
--sč at the end of a word is /ʃ/
word = word:gsub("sč","ʃ")
end
if mw.ustring.find(word,"č") then
word = mw.ustring.toNFC(word)
--sč at the end of a word is /ʧ/
word = word:gsub("č","ʧ")
end
if mw.ustring.find(word,"â") then
word = mw.ustring.toNFC(word)
--sč â at the end of a word is /ʃæ/
word = word:gsub("â","æ")
end
if mw.ustring.find(word,"ğ") then
word = mw.ustring.toNFC(word)
--ğ at the end of a word is /ʤ/
word = word:gsub("ğ","ʤ")
end
-- Decompose combining characters: for instance, è → e + ◌̀
local decomposed = mw.ustring.toNFD(word)
end
-- Transcriptions must contain an acute or grave, to indicate stress position.
-- 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
local transcription = decomposed
-- Handle other cases of c, g.
transcription = mw.ustring.gsub(transcription,
"(([cg])([cg]?)(h?))(.?))",
function (consonant, first, double, second, next)
-- Don't allow the combinations cg, gc.
local consonant
if (next == "e" or next == "ɛ" or next == "i") and second ~= "h" then
if first == 'c' then
consonant = "ʧ"
end -- else return s
end)
-- n a fine parola ha diversa pronuncia transcriptio=mw.ustring.sub(transcription,-1) if transcriptio=='n' then transcription=transcription..' ' transcription=mw.ustring.gsub(transcription,'n ','ŋ') end
-- After a vowel, /ʃ ʎ ɲ/ are doubled.
-- [[w:Italian phonology]] says word-internally, [[w:Help:IPA/Italian]] says
"([kg])(" .. front .. ")",
"%1" .. fronted .. "%2")
:gsub("a", "äa")
:gsub("n", "n̺") -- Converts n before a consonant, which is incorrect.
end
local transcription = "/[" .. export.to_phonemicto_phonetic(word, voiced_z) .. "/]"
return m_IPA.format_IPA_full(