Module:qlu-pron: Difference between revisions

No edit summary
No edit summary
Line 262: Line 262:
dialects["paulistan"] = paulistan
dialects["paulistan"] = paulistan
mw.logObject(ret, "Debug: ret table")
return {phonemic, phonetic}, dialects
return {phonemic, phonetic} --, dialects
end
end


Line 290: Line 288:


function separate_word(term)
function separate_word(term)
     --local phonemic, phonetic, dialects = {}, {}, {}
     local phonemic, phonetic, dialects = {}, {}, {}
local phonemic, phonetic = {}, {}
local m, t, d = "", "", {}
local m, t = "", ""
if match(term, " ") then
if match(term, " ") then
    for word in gsplit(term, " ") do
    for word in gsplit(term, " ") do
        --m, t, d = export.crux(word)
        local ret, d = export.crux(word)
        local ret = export.crux(word)
        m = ret[1]; t = ret[2]
        m = ret[1]; t = ret[2]
         
         
        if #phonemic == 0 or #phonetic == 0 then
        if #phonemic == 0 or #phonetic == 0 then
            --phonemic, phonetic, dialects = {m}, {t}, d
            phonemic, phonetic, dialects = {m}, {t}, d
            phonemic = {m}
            phonetic = {t}
        else
        else
        table.insert(phonemic, m)
        table.insert(phonemic, m)
        table.insert(phonetic, t)
        table.insert(phonetic, t)
        --d = merge_tables(dialects, d)
        d = merge_tables(dialects, d)
        end
        end
    end
    end
Line 314: Line 308:
     end
     end


     return {table.concat(phonemic, " "), table.concat(phonetic, " ")} --, dialects
     return {table.concat(phonemic, " "), table.concat(phonetic, " ")}, dialects
end
end


Line 324: Line 318:
     local args = require("Module:parameters").process(parent_args, params)
     local args = require("Module:parameters").process(parent_args, params)
     local term = args[1]
     local term = args[1]
local ret = export.crux("aggiu") --separate_word(term)
local ret, dialects = separate_word(term)
     local phonemic = ret[1]; local phonetic = ret[2]
     local phonemic = ret[1]; local phonetic = ret[2]
      
      
     local IPA_args = {{pron = '/' .. (phonemic or "test") .. '/', a = "Standard Ravennese"}, {pron = '[' .. (phonetic or "test2") .. ']'}}
     local IPA_args = {{pron = '/' .. (phonemic or "test") .. '/', a = "Standard Ravennese"}, {pron = '[' .. (phonetic or "test2") .. ']'}}
     --[[for key, value in pairs(dialects) do
     for key, value in pairs(dialects) do
     if value ~= phonemic then
     if value ~= phonemic then
     table.insert(IPA_args, {pron = '[' .. value .. ']', a = sub(key, 1, 1), separator = "\n** "})
     table.insert(IPA_args, {pron = '[' .. value .. ']', a = sub(key, 1, 1), separator = "\n** "})
     end
     end
end]]
end


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