Module:User:Sameerhameedy/fa-IPA/romanize

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

Examples

{{Template:User:Sameerhameedy/fa-IPA|آقَا}}

Readings
Classical reading? āqā
Dari reading? āqā
Iranian reading? âğâ
Tajik reading? oqo
{{Template:User:Sameerhameedy/fa-IPA|āqā}}

Readings
Classical reading? āqā
Dari reading? āqā
Iranian reading? âğâ
Tajik reading? oqo
{{Template:User:Sameerhameedy/fa-IPA|قَهْوَه‌اِی}}

Readings
Classical reading? qahwa-ī
Dari reading? qahwa-ī
Iranian reading? ğahve-i
Tajik reading? qahvayi
{{Template:User:Sameerhameedy/fa-IPA|کِتَابِ لَطِیفَه}}

Readings
Classical reading? kitāḇ-i latīfa
Dari reading? kitāb-i latīfa
Iranian reading? ketâb-e latife
Tajik reading? kitobi latifa
{{Template:User:Sameerhameedy/fa-IPA|میوَهٔ جَادُویِی}}

Readings
Classical reading? mēwa-yi jāḏūyī
Dari reading? mēwe jādūyī
Iranian reading? mive-ye jâduyi
Tajik reading? meva-yi joduyi
{{Template:User:Sameerhameedy/fa-IPA|می‌بَخْشین}}

Readings
Classical reading? mē-ḇaxšēn
Dari reading? mē-baxšēn
Iranian reading? mi-baxšin
Tajik reading? me-baxšen
{{Template:User:Sameerhameedy/fa-IPA|اَبَر-نَو-اَخْتَر}}

Readings
Classical reading? aḇar-naw-axtar
Dari reading? abar-naw-axtar
Iranian reading? abar-now-axtar
Tajik reading? abar-nav-axtar
{{Template:User:Sameerhameedy/fa-IPA|مُرْچ|ir=مَرِچ,مُرْچ}}

Readings
Classical reading? murč
Dari reading? murč
Iranian reading? Lua error: bad argument #1 to 'gsub' (string expected, got nil)
Tajik reading? murč
{{Template:User:Sameerhameedy/fa-IPA|هِنْدُوسْتَا`نِی}}

Readings
Classical reading? hindūstānī́
Dari reading? hindūstānī́
Iranian reading? hendustâní
Tajik reading? hindustoní
{{Template:User:Sameerhameedy/fa-IPA|خُ`دَا}}

Readings
Classical reading? xuḏā́
Dari reading? xudā́
Iranian reading? xodấ
Tajik reading? xudó
{{Template:User:Sameerhameedy/fa-IPA|مِهْمَانِی}}

Readings
Classical reading? mihmānī
Dari reading? mehmānī
Iranian reading? mehmâni
Tajik reading? mehmoni

local export = {}

local lang = require("Module:languages").getByCode("fa-cls") --transliteration must be clasical

local U = mw.ustring.char
local consonants = "bptTṭjčhxdDðḍrzžsšʔʾğGfqkglmnŋhɦwvy'" 
local vowels = "aiuāīūüēō"
local consonant = ""
local vowel = ""
local pitchaccent = U(0x301)
local rsplit = mw.text.split
local rsubn = mw.ustring.gsub
local ulen = mw.ustring.len
local hyphen = U(0x02D)
local devoice = U(0x325)
local dtack = U(0x31E)
local gstop = U(0x027)
local dental = U(0x32A)

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

local function fix_romanization(text, sc, options) -- common fixes
	if type(text) == "table" then
		options = {}
		text, script = text.args, text.args
	end
	-- xwV clusters
	text = rsubn(text, "xw", "xW")
	if not sc then
		sc = require("Module:languages").getByCode("fa"):findBestScript(text):getCode()
	end
	if sc == "fa-Arab" then
	text = transliterate(text, sc)
	end
	text = rsubn(text, "xw", "xʷ")
	text = rsubn(text, "W", "w")
	text = rsubn(text, " | ", "# | #")
	text = rsubn(text, "".. " ", ",")
	text = rsubn(text, "", "#,#")
	text = rsubn(text, " ", "# #")
	text = rsubn(text, "^", "#")
	text = rsubn(text, "$", "#")
	text = rsubn(text, "ˈ", "`")
	text = rsubn(text, "`()(?)()", "%1%2%3" .. pitchaccent .. "")
	text = rsubn(text, "`()", "%1" .. pitchaccent .. "")
	text = rsubn(text, "()", "")
	text = rsubn(text, "()", "n")
	text = rsubn(text, "e", "ē")
	text = rsubn(text, "o", "ō")
	text = rsubn(text, "G", "ğ")
	text = rsubn(text, "ḍ", "z")
	text = rsubn(text, "ṭ", "t")
	text = rsubn(text, "ṯ", "s")
	text = rsubn(text, "ṣ", "s")
	text = rsubn(text, "ḥ", "h")
	text = rsubn(text, "v", "w")
	return text
end


function export.romanize_fa_cls(text, sc, options)
	text = fix_romanization(text)
	--ensure vowels are paired to a consonant
	text = rsubn(text, "()()", "%1'%2")
	text = rsubn(text, "()", "")
	text = rsubn(text, "()()", "%1ḏ")
	text = rsubn(text, "((%-?))b", "%1ḇ")
	text = rsubn(text, "ḏ", "ḏ")
	text = rsubn(text, "ḏd", "ḏḏ")
	text = rsubn(text, "ḇb", "ḇḇ")
	-- remove Hazaragi retroflexes
	text = rsubn(text, "D", "d")
	text = rsubn(text, "T", "t")
	text = rsubn(text, "ɖ", "d")
	text = rsubn(text, "ʈ", "t")
	text = rsubn(text, "#()", "")
	text = rsubn(text, "#", "")
	return text
end

function export.romanize_prs(text, sc, options)
	text = fix_romanization(text)
	text = rsubn(text, "i((" .. pitchaccent .. "?))", "e%1")
	text = rsubn(text, "u((" .. pitchaccent .. "?))", "o%1")
	-- Replace xw clusters
	text = rsubn(text, "xw()", "x%1")
	text = rsubn(text, "xwa", "xu")
	text = rsubn(text, "a%-yi", "e")
	text = rsubn(text, "a%-i", "e")
	-- for rare exceptions
	text = rsubn(text, "ʷ", "w")
	--ensure vowels are paired to a consonant
	text = rsubn(text, "()()", "%1'%2")
	text = rsubn(text, "()", "")
	-- THIS SHOULD ONLY BE DONE FOR HAZARAGI RETROFLEX ENTRIES
	-- THEY SHOULD NEVER APPEAR IN A MAIN ENTRY
	text = rsubn(text, "D", "d")
	text = rsubn(text, "T", "t")
	text = rsubn(text, "ɖ", "d")
	text = rsubn(text, "ʈ", "t")
	text = rsubn(text, "ḏ", "z")
	-- remove unnecessary marks
	text = rsubn(text, "#", "")
	return text
end

function export.romanize_ira(text, sc, options)
	text = fix_romanization(text)
	-- Replace xw clusters
	text = rsubn(text, "ʷ", "w")
	text = rsubn(text, "xw()", "x%1")
	text = rsubn(text, "xwa", "xu")
	text = rsubn(text, "w(" .. vowel .. ")", "v%1")
	text = rsubn(text, "w(" .. consonant .. ")", "w%1")
	text = rsubn(text, "()w", "%1v")
	text = rsubn(text, "v%(w", "v(v")
	text = rsubn(text, "(" .. consonant .. ")w#", "%1v#")
	text = rsubn(text, "wv", "vv")
	text = rsubn(text, "wæ", "væ")
	--ensure vowels are paired to a consonant
	text = rsubn(text, "()()", "%1'%2")
	text = rsubn(text, "()", "")
	text = rsubn(text, "iy", "īy")
	text = rsubn(text, "ayy", "Ayy")
	-- Replace diphthong
	text =
		rsubn(
		text,
		"a()()",
		function(semivowel, position)
			local consonant = mw.ustring.sub(text, position, position)
			if consonant == "" or consonant:find(consonant) then
				if semivowel == "w" then
					return "uw"
				else
					return "iy"
				end
			end
		end
	)
	text = rsubn(text, "A", "a")
	text = rsubn(text, "q", "ğ")
	text = rsubn(text, "ā", "â")
	text = rsubn(text, "u", "o")
	text = rsubn(text, "i", "e")
	-- remove Hazaragi retroflexes
	text = rsubn(text, "D", "d")
	text = rsubn(text, "T", "t")
	text = rsubn(text, "ɖ", "d")
	text = rsubn(text, "ʈ", "t")
	text = rsubn(text, "ḏ", "z")
	-- IP does not have vowel length
	text = rsubn(text, "()", "i")
	text = rsubn(text, "()", "u")
	-- terminal w is only possible in a dipthong
	text = rsubn(text, "(0)w#", "v#")
	text = rsubn(text, "a#", "e#")
	text = rsubn(text, "a%-", "e-")
	text = rsubn(text, "æ", "a")
	text = rsubn(text, "#()", "")
	text = rsubn(text, "#", "")
	return text
end

function export.romanize_tg(text, sc, options)
	text = fix_romanization(text)
	text = rsubn(text, "i()", "ē%1")
	text = rsubn(text, "u()", "ō%1")
	text = rsubn(text, "w", "v")
	text = rsubn(text, "ʷ", "v")
	-- Replace xw clusters
	text = rsubn(text, "xv()", "x%1")
	text = rsubn(text, "xva", "xu")
	--ensure vowels are paired to a consonant
	text = rsubn(text, "()()", "%1'%2")
	text = rsubn(text, "()", "")
	text = rsubn(text, "()", "ʾ")
	text = rsubn(text, "ğ", "ġ")
	text = rsubn(text, "ē", "e")
	text = rsubn(text, "ō", "ü")
	text = rsubn(text, "ā", "o")
	-- remove Hazaragi retroflexes
	text = rsubn(text, "D", "d")
	text = rsubn(text, "T", "t")
	text = rsubn(text, "ɖ", "d")
	text = rsubn(text, "ʈ", "t")
	text = rsubn(text, "ḏ", "z")
	-- Tajik does not have vowel length
	text = rsubn(text, "()", "i")
	text = rsubn(text, "`()i#", "%1ī#")
	text = rsubn(text, "()", "u")
	text = rsubn(text, "`", "")
	text = rsubn(text, "ˈ", "")
	text = rsubn(text, "#()", "")
	text = rsubn(text, "#", "")
	text = rsubn(text, "()%-i", "%1yi")
	text = rsubn(text, "%-i", "i")
	return text
end


--- regional/colloquial varieties
local function remove_glottal_c(text) --only for regional dialects
	--completely delete GC if both vowels are the either the same or similar
	text = rsubn(text, "()()(" .. pitchaccent .. "?)()()", "`%1ū")
	text = rsubn(text, "()()(" .. pitchaccent .. "?)()()", "`%1ī")
	text = rsubn(text, "()()(" .. pitchaccent .. "?)()()", "`%1ā")
	-- remove glottal consonants with appropriate glide
	text = rsubn(text, "((" .. pitchaccent .. "?))%-()#", "%1-y%3")
	text = rsubn(text, "((" .. pitchaccent .. "?))%-()#", "%1-y%3")
	text = rsubn(text, "(" .. consonant .. ")%-(" .. vowel .. ")", "%1'%2")
	--ensure vowels are paired to a consonant
	text = rsubn(text, "((" .. pitchaccent .. "?))()()", "%1w%4")
	text = rsubn(text, "()(" .. pitchaccent .. "?)()()", "i%2y%4")
	text = rsubn(text, "((" .. pitchaccent .. "?))()()", "%1y%4")
	text = rsubn(text, "((" .. pitchaccent .. "?))()()", "%1y%4")
	text = rsubn(text, "()(" .. pitchaccent .. "?)()()", "u%2w%4")
	text = rsubn(text, "((" .. pitchaccent .. "?))()()", "%1w%4")
	text = rsubn(text, "()()", "%1%1")
	--Else, turn GC into majhul long vowels
	text = rsubn(text, "()((%.?))", "ā")
	text = rsubn(text, "()((%.?))", "ē")
	text = rsubn(text, "()((%.?))", "ō")

	text = rsubn(text, "()", "")
	-- lastly, remove all remaning GC
	return text
end

function export.romanize_haz(text, sc, options)
	text = fix_romanization(text)
	-- Replace xw clusters
	text = rsubn(text, "xw()", "x%1")
	text = rsubn(text, "xwa", "xu")
	text = rsubn(text, "(" .. vowel .. ")%-()", "%1-y%2")
	text = rsubn(text, "a%-yi", "I")
	text = rsubn(text, "a%-i", "I")
	text = rsubn(text, "%-i#", "-I#")
	text = rsubn(text, "%-i%-", "I-")
	-- for rare exceptions
	text = rsubn(text, "ʷ", "w")
	--ensure vowels are paired to a consonant
	text = rsubn(text, "()()", "%1'%2")
	text = rsubn(text, "()", "")
	-- THIS SHOULD ONLY BE DONE FOR HAZARAGI RETROFLEX ENTRIES
	-- THEY SHOULD NEVER APPEAR IN A MAIN ENTRY
	text = rsubn(text, "D", "ḍ")
	text = rsubn(text, "T", "ṭ")
	text = rsubn(text, "ɖ", "ḍ")
	text = rsubn(text, "ʈ", "ṭ")
	text = rsubn(text, "ḏ", "z")
	--Vowel Harmony
	text = rsubn(text, "ē(" .. pitchaccent .. "?)(" .. consonant .. ")()", "%3%1%2%3")
	text = rsubn(text, "ē(" .. pitchaccent .. "?)(" .. consonant .. ")(" .. consonant .. ")()", "%4%1%2%3%4")
	text = rsubn(text, "i(" .. pitchaccent .. "?)(" .. consonant .. ")()", "%3%1%2%3")
	text = rsubn(text, "ī(" .. pitchaccent .. "?)(" .. consonant .. ")()", "%3%1%2%3")
	text = rsubn(text, "ō(" .. pitchaccent .. "?)(" .. consonant .. ")()", "%3%1%2%3")
	text = rsubn(text, "ō(" .. pitchaccent .. "?)(" .. consonant .. ")()", "u%1%2%3")
	text = rsubn(text, "ō(" .. pitchaccent .. "?)(" .. consonant .. ")()", "ū%1%2%3")
	text = remove_glottal_c(text)
	text = rsubn(text, "i", "ī")
	text = rsubn(text, "u", "ū")
	text = rsubn(text, "I", "i")
	-- remove unnecessary marks
	text = rsubn(text, "#()", "")
	text = rsubn(text, "#", "")
	return text
end

function export.romanize_kbl(text, sc, options)
	text = fix_romanization(text)
	-- Replace xw clusters
	text = rsubn(text, "xw()", "x%1")
	text = rsubn(text, "xwa", "xu")
	text = rsubn(text, "(" .. vowel .. ")%-ī", "%1-yī")
	text = rsubn(text, "a%-yi", "i")
	text = rsubn(text, "a%-i", "i")
	text = rsubn(text, "i(" .. pitchaccent .. "?)#", "I#")
	text = rsubn(text, "i(" .. pitchaccent .. "?)%-#", "I-#")
	-- for rare exceptions
	text = rsubn(text, "ʷ", "w")
	--ensure vowels are paired to a consonant
	text = rsubn(text, "()()", "%1'%2")
	text = rsubn(text, "()", "")
	-- THIS SHOULD ONLY BE DONE FOR HAZARAGI RETROFLEX ENTRIES
	-- THEY SHOULD NEVER APPEAR IN A MAIN ENTRY
	text = rsubn(text, "D", "d")
	text = rsubn(text, "T", "t")
	text = rsubn(text, "ɖ", "d")
	text = rsubn(text, "ʈ", "t")
	text = rsubn(text, "ḏ", "z")
	text = remove_glottal_c(text)
	text = rsubn(text, "I", "i")
	return text
end

return export