Module:lfv-IPA: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(Added phonetic transcription)
No edit summary
Line 144: Line 144:
}
}


function generate_IPA(word, phon)
function generate_IPA(word, phon, col)


local working_IPA = {}
local working_IPA = {}
Line 196: Line 196:
if vowel[p_prev] and intervocalic_voicing[p_current] ~= nil and vowel[p_next] then
if vowel[p_prev] and intervocalic_voicing[p_current] ~= nil and vowel[p_next] then
p_resolve(intervocalic_voicing[p_current])
p_resolve(intervocalic_voicing[p_current])
end
-- colloquial only --
if col then
if p_current == "r" and p_next == "ʃ" then
p_resolve("ʃ")
end
if p_current == "l" and p_next == "l" and working_IPA[i+2] == "i" and vowel[working_IPA[i+3]] then
p_resolve("ʎʎ")
remove_next()
remove_next()
end
if p_current == "n" and p_next == "n" and working_IPA[i+2] == "i" and vowel[working_IPA[i+3]] then
p_resolve("ɲɲ")
remove_next()
remove_next()
end
if p_current == "x" and p_next == "d" then
if vowel[working_IPA[i-2]] and (p_prev == "i" or p_prev == "u") then
table.remove(working_IPA, i)
working_IPA[i-2] = working_IPA[i-2] .. "ː"
p_current = working_IPA[i]
p_next = working_IPA[i+1]
elseif vowel[p_prev] then
p_resolve("ː")
end
end
end
end
Line 290: Line 320:
outputIPA = mw.ustring.gsub(outputIPA, "(%&nbsp%;)", " ")
outputIPA = mw.ustring.gsub(outputIPA, "(%&nbsp%;)", " ")
outputIPA = generate_IPA(outputIPA, parameters["phon"] or false)
outputIPA = generate_IPA(outputIPA, parameters["phon"] or false, parameters["colloquial"] or parameters["col"] or false)
local nolarge = ""
local nolarge = ""