Module:siwa-pron: Difference between revisions

No edit summary
No edit summary
Line 111: Line 111:
function export.morphemes(word)
function export.morphemes(word)
local pss = {}
local pss = {}
 
if gmatch(word,"·") then
if gmatch(word,"·") then
pss = split(word,"·")
pss = split(word,"·")
end
end
repeat
for i, m in ipairs(pss) do
for _, morph in ipairs(pss) do
if m_sm.suffix[m] and gmatch(table.concat(pss),"[ˈˌ]") then
for i=1,15,1 do
elseif m_sm.prefix[m] then
if morph==m_sm.prefix[i] then
pss[i] = "ˌ" .. pss[i]
pss[i] = "ˌ" .. pss[i]
else
end
pss[i] = "ˈ" .. pss[i]
end
end
end
until gmatch(table.concat(pss),"ˈ") and gmatch(table.concat(pss),"ˌ")
end
return table.concat(pss,"·")
return table.concat(pss,"·")
Line 131: Line 130:
function export.crux(term)
function export.crux(term)
local IPA = {}
local IPA = {}
 
term=mw.ustring.lower(term)
term=export.morphemes(term)
term=export.morphemes(term)
Line 151: Line 151:
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]
if term~=mw.title.getCurrentTitle().text then
term=term
else term=mw.ustring.lower(term) end
local ipa = export.crux(term)
local ipa = export.crux(term)