Module:siwa-noun/common: Difference between revisions
No edit summary |
No edit summary |
||
| (45 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
--local word = frame:getParent().args[1] -- for testing | --local word = frame:getParent().args[1] -- for testing | ||
local lenited = "" | local lenited = "" | ||
local v = "([ | local v = "([aeiouyůõảẻỉỏủỷę·])" | ||
local lenition_patterns = { | local lenition_patterns = { | ||
--geminated voiced stops | --geminated voiced stops | ||
| Line 19: | Line 19: | ||
["dl"] = "l", ["([lr])pp"] = "%1p", ["([lr])tt"] = "%1t", ["([lrms])kk"] = "%1k",["ps"] = "bs", ["k([lvs])"] = "g%1", | ["dl"] = "l", ["([lr])pp"] = "%1p", ["([lr])tt"] = "%1t", ["([lrms])kk"] = "%1k",["ps"] = "bs", ["k([lvs])"] = "g%1", | ||
--voiced consonants (▫, arbitrary character to compute diphthongs further down) | --voiced consonants (▫, arbitrary character to compute diphthongs further down) | ||
["vv"] = "ų", [ | ["vv"] = "ų", ["d([aảou])"] = "l%1", ["(.)[dġ]([ieůy])"] = "%1▫%2", [v.."[vųbhḥgd]"..v] = "%1▫%2", ["ġ([aou])"] = "vv%1", ["ġo̊"] = "vvo̊", | ||
--Ci# | --Ci# | ||
[" | ["ri"] = "ṡi", ["nįi"] = "gįi", ["hhį"] = "ṡ", | ||
--long voiceless consonants | --long voiceless consonants | ||
["ḍb"] = "p", ["ḍḍ"] = "hh", ["ḍg"] = "k", | ["ḍb"] = "p", ["ḍḍ"] = "hh", ["ḍg"] = "k", | ||
--semi-vowels | --semi-vowels | ||
["[ou]ų"] = " | ["[ou]ų"] = "ů▫", ["ių"] = "y▫", ["[óú]ų"] = "ẻu▫", ["íų"] = "ỷ▫", | ||
} | } | ||
for regex, repl in pairs(lenition_patterns) do | for regex, repl in pairs(lenition_patterns) do | ||
lenited = gsub(word, regex, repl, 1) | if word:match("·.*·") then | ||
lenited = gsub(word, "·" .. regex .. "·", repl, 1) | |||
else | |||
lenited = gsub(word, regex, repl, 1) | |||
end | |||
if lenited ~= word then return lenited end | if lenited ~= word then return lenited end | ||
end | end | ||
| Line 35: | Line 41: | ||
end | end | ||
export.diphthongs = { | |||
["[aę]▫[aę]"] = "ả", ["e▫e"] = "ẻ", ["i▫i"] = "ỉ", ["u▫[yuů]"] = "ủ", ["[yů]▫u"] = "ủ", | |||
["a▫e"] = "ai", ["a▫o"] = "au", ["ę▫[uů]"] = "ay", | |||
["ę▫[ei]"] = "ei", ["ę▫o"] = "eu", | |||
["e▫[aę]"] = "ia", ["e▫o"] = "io", ["i▫y"] = "iů", | |||
["[uo]▫e"] = "oi", ["o▫ů"] = "ou", | |||
["[yů]▫o"] = "uo", ["o▫o"] = "ỏ", | |||
["y▫y"] = "ỷ", ["ů▫ů"] = "ẻu", | |||
["ẻu▫i"] = "ůbi", | |||
["([ae])▫ů"] = "%1y", ["([iou])▫ę"] = "%1a", | |||
["[yů]▫[aę]"] = "ůa", ["[yů]▫[ei]"] = "ůi", -- to screen out stressed vs. unstressed | |||
} | |||
function export.coalescence(word, stress) | function export.coalescence(word, stress) | ||
for regex, repl in pairs(export.diphthongs) do | |||
for regex, repl in pairs(diphthongs) do | |||
word = gsub(word, regex, repl) | word = gsub(word, regex, repl) | ||
end | end | ||
if stress then | if stress then | ||
word = gsub(word, " | word = gsub(word, "ů[aęei]", "ỷ") | ||
end | end | ||
word = gsub(word, "▫", "") | word = gsub(word, "▫", "") | ||
for regex, repl in pairs( | --[[for regex, repl in pairs(export.triphthong_coalescence) do | ||
word = gsub(word, regex, repl) | word = gsub(word, regex, repl) | ||
end]] | end]] | ||
| Line 100: | Line 85: | ||
["kį"] = "c", ["gį"] = "ɟ", ["hh"] = "ħ", ["ḍḍ"] = "ð", ["dl"] = "ɬ", ["o̊"] = "ȯ", | ["kį"] = "c", ["gį"] = "ɟ", ["hh"] = "ħ", ["ḍḍ"] = "ð", ["dl"] = "ɬ", ["o̊"] = "ȯ", | ||
["õu"] = "ở", ["ẻu"] = "ử", | ["õu"] = "ở", ["ẻu"] = "ử", | ||
} | |||
export.triphthong_coalescence = { | |||
["([aoue])i([aoue])"] = "%1į%2", ["([aoue])ii"] = "%1gįi", ["([aoue])ỉ"] = "%1gįi", ["ai[yů]"] = "ey", | |||
["([eo])i[yů]"] = "%1įů", | |||
["ue([aoue])"] = "uį%1", ["uẻ"] = "uįe", ["uei"] = "ugįi", ["u[ei][yů]"] = "ůgįů", | |||
["ie([aouy])"] = "igį%1", ["iee"] = "iẻ", ["ieů"] = "igįů", | |||
["ůi([aoe])"] = "ůį%1", ["ůi[uyů]"] = "ůgįů", ["ůii"] = "ůgįi", ["ůỉ"] = "ugįi", | |||
["ay([ae])"] = "ęm%1", ["ay([oi])"] = "ęb%1", ["ay[uyů]"] = "ębů", ["aỷ"] = "ębů", | |||
["uo([aue])"] = "um%1", ["uo([oi])"] = "ub%1", ["uỏ"] = "ubo", ["uo[yů]"] = "ůbů", | |||
["au([aueů])"] = "am%1", ["aủ"] = "amu", ["au([oi])"] = "ab%1", ["auy"] = "amů", | |||
["o[ua]([aueů])"] = "om%1", ["oả"] = "oma", ["oủ"] = "omu", ["o[ua]([oi])"] = "ob%1", ["o[ua]y"] = "omů", | |||
["e[uy]([ae])"] = "ům%1", ["e[uy]([oi])"] = "ůb%1", ["e[uy][uyů]"] = "ůbů", ["e[ủỷ]"] = "ůbů", | |||
["iu([aeů])"] = "ivv%1", ["iu([oui])"] = "ib%1", ["iủ"] = "ibu", ["iuy"] = "ivvů", | |||
["ả([aoue])"] = "ęį%1", ["ải"] = "ęgįi", ["[ảẻ][yů]"] = "ey", | |||
["ỏ([aueů])"] = "om%1", ["ỏ([oi])"] = "ob%1", ["ỏy"] = "omů", | |||
["ủ([ae])"] = "um%1", ["ủ([oui])"] = "ub%1", ["ủ[ůy]"] = "ůbů", | |||
["ẻu([ae])"] = "ům%1", ["ẻu([oi])"] = "ůb%1", ["ẻu[uyů]"] = "ůbů", ["ẻủ"] = "ůbů", | |||
["ẻ([ao])"] = "evv%1", ["ẻ([ei])"] = "egį%1", | |||
["ỉ([aou])"] = "ivv%1", ["ỉ([ey])"] = "igį%1", ["ỉi"] = "iddįi", ["iỉ"] = "iddįi", ["ỉů"] = "igįy", | |||
["ỷ([ae])"] = "ym%1", ["ỷ([oi])"] = "yb%1", ["ỷ[uůy]"] = "yby", ["yỷ"] = "yby", | |||
} | } | ||
return export | return export | ||