বিষয়বস্তুতে চলুন

মডিউল:fa-translit

উইকিঅভিধান, মুক্ত অভিধান থেকে

এই মডিউলের জন্য মডিউল:fa-translit/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে

local export = {}
local m_str_utils = require("Module:string utilities")
local gsub = m_str_utils.gsub
local EOW = "([" .. "%s" .. "\n" .. "%p" .. "%x" .. "])"
local POW = "([" .. "%S" .. "]+)"
local hyphen = "<span class=\"Zsym mention\" style=\"font-size:100%;\">&nbsp;/ </span>"

local function basetr(text, lang, sc)
	return require("Module:fa-cls-translit").tr(text, lang, sc)
end

function export.CLS_tr(text)
	-- if // is present, ignore // and everything AFTER
	text = gsub(text, "(//)" .. ".*", "")
	text = basetr(text, lang, sc)
	if text == nil then
		return nil
		end
	return text
end

function export.IRA_tr(text)
	-- if // is present, ignore // and everything BEFORE
	text = gsub(text, "^" .. ".*" .. "(//)", "")
	text = basetr(text, lang, sc)
	if text == nil then
		return nil
	end
	text = require('Module:fa-IPA').romanize_ira(text)
	return text
end

function export.tr(text)
	if export.CLS_tr(text) == nil or export.IRA_tr(text) == nil then
		return nil
		else
	text = export.CLS_tr(text) .. hyphen .. export.IRA_tr(text)
	end
	return text
end

-- for other modules
function export.frame_xlit(text1, text2)
	text = text1 .. hyphen .. text2
	return text
	end

return export