Module:qlu-pron: Difference between revisions

No edit summary
No edit summary
Line 144: Line 144:


local function syllabify(word)
local function syllabify(word)
local clusters = require("Module:table").listToSet({
local clusters = m_table.listToSet({
"s[ptʈkfɸ]", "z[bdgβʤmnlr]",
"s[ptʈkfɸ]", "z[bdgβʤmnlr]",
"[fɸvβpbtʈdkgθð]r", "[fɸvβpbkg]l",
"[fɸvβpbtʈdkgθð]r", "[fɸvβpbkg]l",
Line 246: Line 246:
end
end


--[[if outputs == "phonemic" then
-- testcases
if outputs == "phonemic" then
return phonemic
return phonemic
elseif not outputs or outputs == "phonetic" then
elseif not outputs or outputs == "phonetic" then
Line 252: Line 253:
elseif outputs == "test" then
elseif outputs == "test" then
return "/" .. phonemic .. "/ [" .. phonetic .. "]"
return "/" .. phonemic .. "/ [" .. phonetic .. "]"
end]]
end
ret.phonemic = phonemic
ret.phonemic = phonemic
Line 259: Line 260:
ret.dialectal.bolognese = bolognese
ret.dialectal.bolognese = bolognese
ret.dialectal.paulistan = paulistan
ret.dialectal.paulistan = paulistan
-- Debug output
mw.logObject(ret, "Debug: ret table")
return ret
return ret
Line 315: Line 313:
     local ret = separate_word(term)
     local ret = separate_word(term)


    -- Format the IPA output using the phonetic transcription
     local IPA_args = {{pron = '/' .. ret.phonemic .. '/', a = "Standard Ravennese"}, {pron = '[' .. ret.phonetic .. ']'}}
     local IPA_args = { { pron = '[' .. ret.dialectal.upper .. ']' } }
    for key, value in pairs(ret.dialectal) do
    if value ~= ret.phonemic then
    table.insert(IPA_args, {pron = '[' .. value .. ']', a = sub(key, 1, 1), separator = "\n** "})
    end
end


     return "* " .. m_IPA.format_IPA_full({ lang = lang, items = IPA_args })
     return "* " .. m_IPA.format_IPA_full({ lang = lang, items = IPA_args })