This module implements the reference template {{R:be:Verbum}}
.
-- This module is intended to support making references to https://verbum.by dictionaries
local export = {}
local subst_tbl = {
= "A",
= "a",
= "B",
= "b",
= "V",
= "v",
= "H",
= "h",
= "D",
= "d",
= "Zh",
= "zh",
= "Z",
= "z",
= "I",
= "i",
= "J",
= "j",
= "K",
= "k",
= "L",
= "l",
= "M",
= "m",
= "N",
= "n",
= "O",
= "o",
= "P",
= "p",
= "R",
= "r",
= "S",
= "s",
= "T",
= "t",
= "U",
= "u",
= "U",
= "u",
= "F",
= "f",
= "Ch",
= "ch",
= "C",
= "c",
= "Ch",
= "ch",
= "Sh",
= "sh",
= "",
= "",
= "",
= "Y",
= "y",
= "",
= "",
= "E",
= "e",
= "je",
= "jo",
= "ju",
= "ja",
= "Je",
= "Jo",
= "Ju",
= "Ja",
}
local subst_tbl_after_consonant = {
= "ie",
= "io",
= "iu",
= "ia",
= "ie",
= "io",
= "iu",
= "ia",
}
-- Lua implementation of https://github.com/verbumby/verbum/blob/master/backend/textutil/romanize_belarusian.go
function export.RomanizeBelarusian(frame)
local params = {
= {required = true},
}
local args = require("Module:parameters").process(frame.args, params)
local s = args
s = mw.ustring.gsub(s, "'", "'")
s = mw.ustring.gsub(s, "(?)()", function (prev, cur)
if prev == "" then
return cur
else
return prev .. subst_tbl_after_consonant
end
end)
s = mw.ustring.gsub(s, ".", subst_tbl)
return s
end
return export