Module:inc-mbn-translit/sandbox

From Wiktionary, the free dictionary
Jump to navigation Jump to search

local export = {}
local gsub = mw.ustring.gsub
local match = mw.ustring.match

local char = {
	["ৰ"] = "r", ["ৱ"] = "w"
}


function export.tr(text, lang, sc, override)
	local UTF8_char = "[%z\1-\127\194-\244][\128-\191]*"
	local Beng = require("Module:scripts").getByCode("Beng")
	text = mw.ustring.toNFD(text)

	text = string.gsub(text, UTF8_char, char)
	text = require("Module:bn-translit").tr(text, lang, sc, true)
	text = gsub(text, ".[়’]?", char)
	text = gsub(text, ".", char)
end

return export