Module:ii-translit

From Linguifex
Jump to navigation Jump to search

Documentation for this module may be created at Module:ii-translit/doc

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

local convert = mw.loadData("Module:ii-translit/data")

function export.tr(text, lang, sc)
	text = gsub(text:gsub("%^", ""), "[^%s*]", " %0")
	text = gsub(text, " ([%Aꀕ])", "%1") -- Iteration mark appends "w" onto previous syllable.
	return (gsub(text, "%S", convert))
end

return export