45,337
edits
No edit summary |
No edit summary |
||
Line 19: | Line 19: | ||
local consonant = "[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦʔƀꝺđɣꬶɉ]" .. UNRELEASED .. "?" | local consonant = "[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦʔƀꝺđɣꬶɉ]" .. UNRELEASED .. "?" | ||
local front_vowel = "iɪyeøɛœæa" | local front_vowel = "iɪyeøɛœæa" | ||
local back_vowel = "uɔ" .. NASALIZED .. "? | local back_vowel = "uɔ" .. NASALIZED .. "?ɑʊɤ" | ||
local vowel = "[" .. front_vowel .. back_vowel .. "ɨ]" | local vowel = "[" .. front_vowel .. back_vowel .. "ɨ]" | ||
Line 27: | Line 27: | ||
local spat4 = "(·?ˈ[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦ⁽ʰ⁾ʔːƀꝺđɣꬶɉ]*"..UNRELEASED.."?"..vowel..")(đ)([^ː])" | local spat4 = "(·?ˈ[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦ⁽ʰ⁾ʔːƀꝺđɣꬶɉ]*"..UNRELEASED.."?"..vowel..")(đ)([^ː])" | ||
local spat5 = "(·?ˈ[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦ⁽ʰ⁾ʔːƀꝺđɣꬶɉ]*"..UNRELEASED.."?"..vowel..")(ꝺ)([^ː])" | local spat5 = "(·?ˈ[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦ⁽ʰ⁾ʔːƀꝺđɣꬶɉ]*"..UNRELEASED.."?"..vowel..")(ꝺ)([^ː])" | ||
local function ncategories(categories) | |||
local out_categories = {} | |||
for key, cat in ipairs(categories) do | |||
out_categories[key] = "[[Category:" .. cat .. "]]" | |||
end | |||
return table.concat(out_categories, "") | |||
end | |||
local function open_to_closed(v, a) | local function open_to_closed(v, a) | ||
Line 245: | Line 255: | ||
return table.concat(IPA) | return table.concat(IPA) | ||
end | end | ||
local function format_dialect(term, dialect) | |||
local function IPA_format(items) | |||
local bits = {} | |||
local prefix = "[[w:IPA chart|IPA]]<sup>([[IPA for Siwa|key]])</sup>: " | |||
local span = "<span style=\"font-size:110%;font-family:Gentium,'DejaVu Sans','Segoe UI',sans-serif>" | |||
for _, item in ipairs(items) do | |||
local bit = item.pron | |||
table.insert(bits, bit) | |||
end | |||
return prefix .. span .. items.pron .. "</span>" | |||
end | |||
local prons = {} | |||
for _, done in ipairs(replaced) do | |||
local phonetic = replaced[1] | |||
local IPA_args = {{pron = '[' .. phonetic .. ']'}} | |||
table.insert(prons, IPA_format(IPA_args)) | |||
end | |||
return "(''"..dialect.."'') " .. table.concat(prons, ' or ') | |||
end | |||
function export.show(frame) | function export.show(frame) | ||
local params = { | local params = { | ||
[1] = { default = mw.title.getCurrentTitle().nsText == 'Template' and "uįo·sauṡṡi" or mw.title.getCurrentTitle().text }, | [1] = { default = mw.title.getCurrentTitle().nsText == 'Template' and "uįo·sauṡṡi" or mw.title.getCurrentTitle().text }, | ||
a = {type = 'boolean', default = true}, | |||
e = {type = 'boolean', default = true}, | |||
w = {type = 'boolean', default = true}, | |||
acc = {list = true}, | |||
} | } | ||
local args = require("Module:parameters").process( | |||
local args = require("Module:parameters").process(frame:getParent().args, params) | |||
local term = args[1] | local term = args[1] | ||
local accent = args.acc | |||
local categories = {} | |||
local ipa = export.crux(term) | local ipa = "* " | ||
if args.a then | |||
ipa = ipa .. format_dialect(export.crux(term, false, false), accent and #accent > 0 or {'Aingo'}) | |||
end | |||
if args.e then | |||
if args.a then | |||
ipa = ipa .. "\n* " | |||
end | |||
out = out .. format_dialect(export.crux(term, true, false), accent and #accent > 0 or {'Eastern'}) | |||
table.insert(categories, "Siwa terms with Eastern IPA pronunciation") | |||
end | |||
ipa = " | if args.w then | ||
if args.a or args.e then | |||
ipa = ipa .. "\n* " | |||
end | |||
ipa = ipa .. format_dialect(export.crux(term, false, true), accent and #accent > 0 or {'Western'}) | |||
table.insert(categories, "Siwa terms with Western IPA pronunciation") | |||
end | |||
return ipa .. ncategories(categories) | |||
end | end | ||
return export | return export |