Module:siwa-noun: Difference between revisions
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
local m_u = require('Module:utilities') | local m_u = require('Module:utilities') | ||
--local m_data = require('Module:siwa-noun/data') | --local m_data = require('Module:siwa-noun/data') | ||
| Line 27: | Line 26: | ||
} | } | ||
local | local lenition_patterns = { | ||
["bb"] = "b", ["dd"] = "d", ["gg"] = "g", ["ɟ"] = "į", ["mm"] = "m", ["ll"] = "l", ["nn"] = "n", | ["bb"] = "b", ["dd"] = "d", ["gg"] = "g", ["ɟ"] = "į", ["mm"] = "m", ["ll"] = "l", ["nn"] = "n", | ||
["rr"] = "r", ["bġ"] = "p", ["pr"] = "p", ["dġ"] = "t", ["tr"] = "t", ["ḍb"] = "p", ["ð"] = "hh", | ["rr"] = "r", ["bġ"] = "p", ["pr"] = "p", ["dġ"] = "t", ["tr"] = "t", ["ḍb"] = "p", ["ð"] = "hh", | ||
| Line 79: | Line 78: | ||
return gender .. "-" .. sub(word, -1) .. "-" .. tonic_vowel | return gender .. "-" .. sub(word, -1) .. "-" .. tonic_vowel | ||
end | end | ||
end | end | ||
end | |||
local function lenition(word) | |||
local _, c = stressed_components(word) | |||
for regex, repl in pairs(lenition_patterns) do | |||
local lenited = gsub(c, regex, repl) | |||
end | |||
return sub(word, 1, find(word, c)) .. lenited .. sub(word, -(#c+1)) | |||
end | end | ||
| Line 100: | Line 105: | ||
local prefix = sub(pagename, 1, -(#word+1)) | local prefix = sub(pagename, 1, -(#word+1)) | ||
return | return lenition(word) | ||
end | end | ||
return export | return export | ||