Module:siwa-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 66: Line 66:
return table.concat(pss,"·")
return table.concat(pss,"·")
end
local function detect_dialect(term)
if find(term, "̊") or find(term, "ṡ$") or find(term, "rg") or find(term, "bġ") then
return "e"
elseif find(term, "[ṁṅłƛ]") then
return "w"
end
end
end


Line 169: Line 177:
}
}


function export.crux(term, e, w)
function export.crux(term, a, e, w)
term=mw.ustring.lower(term)
term=mw.ustring.lower(term)
term=export.morphemes(term)
term=export.morphemes(term)
Line 241: Line 249:
local ipa = "* "
local ipa = "* "
if args.a then
if detect_dialect(term) == "e" then
ipa = ipa .. line_format(export.crux(term, false, false), {'Aingo'})
ipa = ipa .. line_format(export.crux(term, false, true, false), {'Eastern'})
table.insert(categories, "Eastern Siwa lemmas")
table.insert(categories, "Siwa lemmas with Eastern IPA pronunciation")
elseif detect_dialect(term) == "w" then
ipa = ipa .. line_format(export.crux(term, false, false, true), {'Western'})
table.insert(categories, "Western Siwa lemmas")
table.insert(categories, "Siwa lemmas with Western IPA pronunciation")
elseif args.a then
ipa = ipa .. line_format(export.crux(term, true, false, false), {'Aingo'})
end
end
if args.e then
if args.e then
if export.crux(term, false, false) ~= export.crux(term, true, false) then
if export.crux(term, true, false, false) ~= export.crux(term, false, true, false) then
if args.a  then
if args.a  then
ipa = ipa .. "\n* "
ipa = ipa .. "\n* "
end
end
ipa = ipa .. line_format(export.crux(term, true, false), {'Eastern'})
ipa = ipa .. line_format(export.crux(term, true, true, false), {'Eastern'})
table.insert(categories, "Siwa lemmas with Eastern IPA pronunciation")
table.insert(categories, "Siwa lemmas with Eastern IPA pronunciation")
end
end
Line 256: Line 272:
if args.w then
if args.w then
if export.crux(term, false, false) ~= export.crux(term, false, true) then
if export.crux(term, true, false, false) ~= export.crux(term, false, false, true) then
if args.a or args.e then
if args.a or args.e then
ipa = ipa .. "\n* "
ipa = ipa .. "\n* "
end
end
ipa = ipa .. line_format(export.crux(term, false, true), {'Western'})
ipa = ipa .. line_format(export.crux(term, true, false, true), {'Western'})
table.insert(categories, "Siwa lemmas with Western IPA pronunciation")
table.insert(categories, "Siwa lemmas with Western IPA pronunciation")
end
end