Sandbox module of User:Rua.
{ = { = "^$", }, = { = "^nj$", }, = { = "^j$", }, = { = "^()$", }, = { = "^z$", }, = { = "^ž$", }, = { = "^g$", }, = { = "^b$", }, = { = "^đ$", }, = { = "^h()$", }, = { = "^ŋ$", }, = { = "^m$", }, = { = "^n(j?)$", }, = { = "^nj$", }, }
local m_debug = require("Module:debug")
local export = {}
local scons = {
= {
{"^$"},
{"^nj$"},
},
= {
{"^dj$", "j", "ddj"},
{"^()%1$", "%1", "%1ˈ%1"},
{"^hc$", "z", "hcc"},
{"^hč$", "ž", "hčč"},
{"^hk$", "g", "hkk"},
{"^hp$", "b", "hpp"},
{"^ht$", "đ", "htt"},
{"^h()%1$", "h%1", "h%1ˈ%1"},
{"^kŋ$", "ŋ", "gŋ"},
{"^pm$", "m", "bm"},
{"^tn(j?)$", "n%1", "dn%1"},
{"^nnj$", "nj", "nˈnj"},
{"^cc$"},
{"^čč$"},
{"^pp$"},
{"^tt$"},
{"^lj$"},
{"^i()%1$"},
{"^l()%1$"},
{"^lstt$"},
{"^n()%1$"},
{"^ŋ()%1$"},
{"^s()%1$"},
{"^r()%1$"},
{"^rpm$"},
{"^rtn$"},
{"^t()%1$"},
{"^v()%1$"},
{"^vnnj$"},
},
= {
{"^bb$", "pp"},
{"^dd$", "tt"},
{"^gg$", "kk"},
{"^zz$", "cc"},
{"^žž$", "čč"},
{"^bm$", "pm"},
{"^dn(j?)$", "tn%1"},
{"^gŋ$", "kŋ"},
{"^()%1j$", "%1j"},
{"^()ˈ%1$", "%1%1"},
{"^h()%1$", "h%1"},
{"^h()ˈ%1$", "h%1%1"},
{"^nˈnj$", "nnj"},
-- Clusters
{"^lˈj$", "ljj"},
{"^rbm$", "rpm"},
{"^rdn$", "rtn"},
{"^rdnj$", "rtnj"},
{"^rgŋ$", "rkŋ"},
{"^k(.*)(.)$", "v%1%2%2"},
{"(.)bm$", "%1mm"},
{"(.)dn(j?)$", "%1nn%2"},
{"(.)gŋ$", "%1ŋŋ"},
--{"(.)(.)$", "%1%2%2"},
{"^đ()$", "i%1%1"},
{"^i()$", "i%1%1"},
{"^ih()$", "ih%1%1"},
{"^is()$", "is%1%1"},
{"^l()$", "l%1%1"},
{"^ls()$", "ls%1%1"},
{"^m()$", "m%1%1"},
{"^n()$", "n%1%1"},
{"^ŋ()$", "ŋ%1%1"},
{"^p()$", "r%1%1"},
{"^r()$", "r%1%1"},
{"^rs()$", "rs%1%1"},
{"^s()$", "s%1%1"},
{"^š()$", "s%1%1"},
{"^t()$", "t%1%1"},
{"^v()$", "v%1%1"},
{"^vh()$", "vh%1%1"},
{"^ij$"},
{"^lfr$"},
},
}
function export.test(frame)
for _, pattern in ipairs(scons) do
if pattern then
local i = 1
local newpattern = pattern
if pattern:sub(1, 1) == "^" then
newpattern = "^" .. newpattern
end
if pattern:sub(-1) == "$" then
newpattern = newpattern .. "$"
end
for match in mw.ustring.gmatch(pattern, "%(+%)") do
newpattern = mw.ustring.gsub(newpattern, "%%" .. i, match, 1)
i = i + 1
end
table.insert(scons, {newpattern})
end
end
return require("Module:debug").dump(scons)
end
return export