Module:siwa-noun/common: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
local gsub = mw.ustring.gsub
local gsub = mw.ustring.gsub
local paren = mw.ustring.char(0x0028) .. mw.ustring.char(0x0029)


local export = {}
local export = {}
Line 6: Line 8:
--local word = frame:getParent().args[1] -- for testing
--local word = frame:getParent().args[1] -- for testing
local lenited = ""
local lenited = ""
local v = "([aeiouyůõảẻỉỏủỷę<>])"
local v = "([aeiouyůõảẻỉỏủỷę" .. paren .. "])"
local lenition_patterns = {
local lenition_patterns = {
--geminated voiced stops
--geminated voiced stops
Line 29: Line 31:
for regex, repl in pairs(lenition_patterns) do
for regex, repl in pairs(lenition_patterns) do
if word:match("<.*>") then
if word:match("%(.*%)") then
lenited = gsub(word, "<" .. regex .. ">", repl, 1)
lenited = gsub(word, "%(" .. regex .. "%)", repl, 1)
lenited = gsub(lenited, "<(.*)>", "r")
else
else
lenited = gsub(word, regex, repl, 1)
lenited = gsub(word, regex, repl, 1)

Navigation menu