Module:mg-spel: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 94: Line 94:
local function aw(term, mutation)
local function aw(term, mutation)
local mutated = nil
local mutated = ""
for regex, repl in pairs(mutation == "nasal" and npat or spat) do
for regex, repl in pairs(mutation == "nasal" and npat or spat) 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" end)
--mutated = gsub(mutated, "^k(.)", function(foo) return match(foo, "[aou]") and "c" or "qu" end)
if mutated ~= word then return mutated end
if mutated ~= word then return mutated end
end
end
mutated = gsub(mutated, "^k(.)", function(foo) return match(foo, "[aou]") and "c" or "qu" end)
--mutated = gsub(mutated, "^k(.)", function(foo) return match(foo, "[aou]") and "c" or "qu" end)
return not mutated and unchanged
return unchanged
end
end
local function link(term, uc)
local function link(term)
local links = {}
local links = {}
for alt in gmatch(term, "([^%s,]+)") do
for alt in gmatch(term, "([^%s,]+)") do
if uc then alt = gsub(alt, "^(.)", function(foo) return mw.ustring.upper(foo) end) end
alt = "[[Contionary:" .. alt .. "|" .. alt .. "]]"
alt = "[[Contionary:" .. alt .. "|" .. alt .. "]]"
table.insert(links, alt)
table.insert(links, alt)
Line 127: Line 126:
|-
|-
| ]=] .. link(term, uc) .. [=[​
| ]=] .. link(term, uc) .. [=[​
| ]=] .. link(aw(term, "soft"), uc) .. [=[​
| ]=] .. link(aw(term, "soft")) .. [=[​
| ]=] .. link(aw(term, "nasal"), uc) .. [=[​
| ]=] .. 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 class="plainlinks">[https://drive.google.com/file/d/1AIZ_FwLek3nKrYsbE9sZxTZmi_pwf7DR “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 class="plainlinks">[https://drive.google.com/file/d/1AIZ_FwLek3nKrYsbE9sZxTZmi_pwf7DR “Mutation in Modern Gallaecian”]</span>, ''Segments'' (01-07), April 2021.</span></div>

Navigation menu