Module:qlu-pron: Difference between revisions
No edit summary |
No edit summary |
||
| Line 262: | Line 262: | ||
dialects["paulistan"] = paulistan | dialects["paulistan"] = paulistan | ||
return {phonemic, phonetic}, dialects | |||
return {phonemic, phonetic} | |||
end | end | ||
| Line 290: | Line 288: | ||
function separate_word(term) | function separate_word(term) | ||
local phonemic, phonetic, dialects = {}, {}, {} | |||
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 | ||
local ret, d = 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 | |||
else | else | ||
table.insert(phonemic, m) | table.insert(phonemic, m) | ||
table.insert(phonetic, t) | table.insert(phonetic, t) | ||
d = merge_tables(dialects, d) | |||
end | end | ||
end | end | ||
| Line 314: | Line 308: | ||
end | end | ||
return {table.concat(phonemic, " "), table.concat(phonetic, " ")} | 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 = | 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 | |||
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 }) | ||