Module:mg-spel: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 22: Line 22:
-- Spanish
-- Spanish
e = e:gsub("il", "ll")
e = e:gsub("il(.)", "ll%1")
e = e:gsub("v", "b")
e = e:gsub("v", "b")
e = e:gsub("([^c])[gh]", "%1j")
e = e:gsub("([^c])[gh]", "%1j")
-- Asturian    
-- Asturian    
a = a:gsub("il", "ll")
a = a:gsub("il(.)", "ll%1")
a = a:gsub("v", "b")
a = a:gsub("v", "b")
-- Southern
-- Southern
s = s:gsub("ñ", "nh")
s = s:gsub("ñ", "nh")
s = s:gsub("il", "lh")
s = s:gsub("il(.)", "lh%1")
s = s:gsub("v", "b")
s = s:gsub("v", "b")
local lh = match(s, "lh")
local lh = match(s, "lh")
Line 39: Line 39:
c = c:gsub("c([aou])", "k%1")
c = c:gsub("c([aou])", "k%1")
c = c:gsub("qu([ei])", "k%1")
c = c:gsub("qu([ei])", "k%1")
c = c:gsub("ñ", "in")
c = c:gsub("([^i])ñ", "%1in")
c = c:gsub("x", "is")
c = c:gsub("([^i])x", "%1is")
-- disclaimer: awful approach below, your physical and mental integrity may be at risk
-- disclaimer: awful approach below, your physical and mental integrity may be at risk
Line 73: Line 73:
table.insert(ret, "* " .. link(c) .. " " .. m_q.format_qualifier({"Celtic"}) .. "\n")
table.insert(ret, "* " .. link(c) .. " " .. m_q.format_qualifier({"Celtic"}) .. "\n")
end
end
table.insert(ret, 1, "===Alternative forms===")
table.insert(ret, 2, "\n")
if e == term and a == term and c == term and s == term then
if e == term and a == term and c == term and s == term then
error('Delete me')
ret = {"aa", "aa"}
end
end
Line 86: Line 89:
local unchanged = "''unchanged''"
local unchanged = "''unchanged''"
local spat = {
local soft = {
["p"] = "b", ["b"] = "v", ["d"] = "z", ["t"] = "d", ["g"] = "h", ["c"] = "g", ["q"] = "g",  
["p"] = "b", ["b"] = "v", ["d"] = "z", ["t"] = "d", ["g"] = "h", ["c"] = "g", ["q"] = "g",  
["P"] = "B", ["B"] = "V", ["D"] = "Z", ["T"] = "D", ["G"] = "H", ["C"] = "G", ["Q"] = "G",  
["P"] = "B", ["B"] = "V", ["D"] = "Z", ["T"] = "D", ["G"] = "H", ["C"] = "G", ["Q"] = "G",  
}
}
local npat = {
local nasal = {
["m"] = "v", ["b"] = "m", ["d"] = "n", ["g"] = "k",
["m"] = "v", ["b"] = "m", ["d"] = "n", ["g"] = "k",
["M"] = "V", ["B"] = "M", ["D"] = "N", ["G"] = "K"
["M"] = "V", ["B"] = "M", ["D"] = "N", ["G"] = "K"
Line 97: Line 100:
local function aw(term, mutation)
local function aw(term, mutation)
local mutated = ""
local mutated = ""
for regex, repl in pairs(mutation == "nasal" and npat or spat) do
for regex, repl in pairs(mutation) do
mutated = gsub(term, "^" .. regex, repl, 1)
mutated = gsub(term, "^" .. regex, repl, 1)
mutated = gsub(mutated, "^k(.)", function(foo) return (match(foo, "[aou]") and "c" or "qu") .. foo end)
mutated = gsub(mutated, "^k(.)", function(foo) return (match(foo, "[aou]") and "c" or "qu") .. foo end)
Line 125: Line 128:
! Radical
! Radical
! Soft
! Soft
! Hard
! Nasal
|-
|-
| ]=] .. link(term, uc) .. [=[​
| ]=] .. link(term, uc) .. [=[​
| ]=] .. link(aw(term, "soft")) .. [=[​
| ]=] .. link(aw(term, soft)) .. [=[​
| ]=] .. link(aw(term, "nasal")) .. [=[​
| ]=] .. link(aw(term, nasal)) .. [=[​
|-
|-
| colspan=3 style="font-size: 89%; text-align: left;" | <div class="dummy-footnote" style="font-size: 90%; margin-bottom: 0.5em; margin-left: 2em;">1.&#32;<span style="color: #002bb8;">^</span>&#32;<span class="citation">Christian Evans, (2021). <span title="See link">[[Template:mg-mut/doc|“Mutation in Modern Gallaecian”]]</span>, ''Segments'' (01-07), April 2021.</span></div>
| colspan=3 style="font-size: 89%; text-align: left;" | <div class="dummy-footnote" style="font-size: 90%; margin-bottom: 0.5em; margin-left: 2em;">1.&#32;<span style="color: #002bb8;">^</span>&#32;<span class="citation">Christian Evans, (2021). <span title="See link">[[Template:mg-mut/doc#References|“Mutation in Modern Gallaecian”]]</span>, ''Segments'' (01-07), April 2021.</span></div>
|}
|}]=]
]=]
return wikicode
return wikicode