Module:fa-translit

Hello, you have come here looking for the meaning of the word Module:fa-translit. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:fa-translit, but we will also tell you about its etymology, its characteristics and you will know how to say Module:fa-translit in singular and plural. Everything you need to know about the word Module:fa-translit you have here. The definition of the word Module:fa-translit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:fa-translit, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Generates both the Classical romanization and the Iranian romanization, from the classical vocalization, using module:fa-cls-translit as a backend. Still a work-in-progress. To transliterate Classical Persian and Iranian Persian text independently use their independent transliteration modules listed below:

Override Iranian romanization

The outputted Iranian romanization can be overwritten by vocalizing the word twice (using classical vocalization) with both vocalizations separated by //. This will cause the text to the left of the // to be the outputted classical romanization and the text on the right to be the outputted Iranian romanization. Be aware that, due to how MediaWiki processes bidirectional text, the vocalizations may appear to switch sides when viewed from the Wikitext editor.

Example 1
Input: نَمی‌دَانَم//نِمی‌دَانَم
Output: namē-dānam / nemi-dânam
Example 2
Input: خَانَگِی//خَانِگِی
Output: xānagī / xânegi
Example 3
Input: موز//مَوْز
Output: mōz / mowz

Tests

All tests passed. (refresh)

TextExpectedActual
test_translit_persian:
Passedگویَا کِهgōyā ki / guyâ kegōyā ki / guyâ ke
Passedحُقُوقhuqūq / hoġuġhuqūq / hoġuġ
Passedدَقِیقَهdaqīqa / daġiġedaqīqa / daġiġe
Passedخْوَرَاسَانxwarāsān / xorâsânxwarāsān / xorâsân
Passedخْویشxwēš / xišxwēš / xiš
Passedروزrōz / ruzrōz / ruz
Passedوَلیکِنwalēkin / valikenwalēkin / valiken
Passedشُویْšūy / šuyšūy / šuy
Passedشویْšōy / šuyšōy / šuy
Passedشِیرšīr / širšīr / šir
Passedشیرšēr / širšēr / šir
Passedشَوْهَرšawhar / šowharšawhar / šowhar
Passedکَسیkasē / kasikasē / kasi
Passedگویِشgōyiš / guyešgōyiš / guyeš
Passedبَیْنُ‌المِلَلِیbaynu-l-milalī / beyno-l-melalibaynu-l-milalī / beyno-l-melali
Passedشَوِیšawī / šavišawī / šavi
Passedشِوِیšiwī / ševišiwī / ševi
Passedشُویšuwē / šovišuwē / šovi
Passedخْوَدْرَوxwadraw / xodrowxwadraw / xodrow
Passedحقوق(nil)(nil)
Passedعشق(nil)(nil)
Passedنَمی‌دَانَم / نِمی‌دَانَمnamē-dānam / nemi-dânamnamē-dānam / nemi-dânam
Passedخَانَگِی / خَانِگِیxānagī / xânegixānagī / xânegi
Passedموز / مَوْزmōz / mowzmōz / mowz

local export = {}
local m_str_utils = require("Module:string utilities")
local gsub = m_str_utils.gsub
local EOW = "()"
local POW = "(+)"
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