Module:fi-dialects/helper
Jump to navigation
Jump to search
- This module lacks a documentation subpage. Please create it.
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
local export = {}
local function add_word(syns, parish, word)
if not syns[parish] then
syns[parish] = word
elseif type(syns[parish]) == "string" then
syns[parish] = { syns[parish], word }
else
table.insert(syns[parish], word)
end
end
function export.add_word_for(syns, word, parishes)
if type(parishes) == "string" then
for parish in mw.text.gsplit(parishes, ",") do
add_word(syns, mw.ustring.gsub(mw.text.trim(parish), "[ .]", ""), word)
end
else
for _, parish in ipairs(parishes) do
add_word(syns, parish, word)
end
end
end
return export