မာတိကာသို့ ခုန်သွားရန်

မဝ်ဂျူ:grc-pronunciation/data

နူ ဝိက်ရှေန်နရဳ

This module contains data used by Module:grc-pronunciation


local ipairs = ipairs
local pairs = pairs
local toNFD = mw.ustring.toNFD
local U = require("Module:string utilities").char

local m_utils_data = require("Module:grc-utilities/data")
local diacritics = m_utils_data.diacritics

local nonsyllabic = U(0x32F)
local high = U(0x341) -- combining acute tone mark
local low = U(0x340) -- combining grave tone mark
local midHigh = U(0x1DC4) -- mid–high pitch
local midLow = U(0x1DC6) -- mid–low pitch
local highMid = U(0x1DC7) -- high–mid pitch
local rising = U(0x30C)		-- combining caron
local falling = diacritics.Latin_circum	-- combining circumflex
local voiceless = U(0x325) -- combining ring below
local aspirated = "ʰ"
local stress_mark = "ˈ"
local long = "ː"
local macron = diacritics.spacing_macron
local breve = diacritics.spacing_breve

local circumflex_on_long_vowel = falling
local acute_on_long_vowel = rising
local acute_on_short_vowel = high
local grave_pitch_mark = low

local pre_hasMacronBreve = { { "0~hasMacronBreve", 1 }, 0 }
local pre_hasSubI = { { "0~hasSubI", 1 }, 0 }
local pre_hasMacronBreve_hasSubI = { { "0~hasMacronBreve/0~hasSubI", 1 }, 0 }

local data = {}

-- Letters which can be treated as allographs of other letters.
local aliases = {}
for k, v in pairs{
	["κͱ"] = "χ",
	["ξ"] = "κσ",
	["ϝͱ"] = "ϝ̔",
	["λͱ"] = "λ̔",
	["πͱ"] = "φ",
	["ϻ"] = "σ",
	["ϙ"] = "κ",
	["ϙͱ"] = "χ",
	["ς"] = "σ",
	["τͱ"] = "θ",
	["ψ"] = "πσ"
} do
	aliases[toNFD(k)] = toNFD(v)
end
data.aliases = aliases

data[" "] = {
	["p"] = {
		["cla"] = " ",
		["koi1"] = " ",
		["koi2"] = " ",
		["byz1"] = " ",
		["byz2"] = " ",
	},
}

data["β"] = {
	["p"] = {
		["cla"] = "b",
		["koi1"] = "b",
		["koi2"] = {
			{ "-1=μ", "b" },
			"β"
		},
		["byz1"] = {
			{ "-1=μ", "b" },
			"v"
		},
		["byz2"] = {
			{ "1=β", "" },
			{ "-1=μ", "b" },
			"v",
		},
	},
}

data["γ"] = {
	["p"] = {
		["cla"] = {
			{ "1.dorsal/1=μ", "ŋ" },
			"ɡ",
		},
		["koi1"] = {
			{ "1.dorsal", "ŋ" },
			"ɡ",
		},
		["koi2"] = {
			{ "1.dorsal",
				{
					{ "1~preFront", "ɲ" },
					"ŋ",
				},
			},
			{ "0~preFront",
				{
					{ "-1=γ/-1=ν", "ɟ" },
					"ʝ",
				},
			},
			{ "-1=γ/-1=ν", "ɡ" },
			"ɣ",		},
		["byz1"] = {
			{ "1.dorsal",
				{
					{ "1~preFront", "ɲ" },
					"ŋ",
				},
			},
			{ "0~preFront",
				{
					{ "-1=γ/-1=ν", "ɟ" },
					"ʝ",
				},
			},
			{ "-1=γ/-1=ν", "ɡ" },
			"ɣ",
		},
		["byz2"] = {
			{ "1.dorsal",
				{
					{ "1~preFront", "ɲ" },
					"ŋ",
				},
			},
			{ "0~preFront",
				{
					{ "-1=γ/-1=ν", "ɟ" },
					"ʝ",
				},
			},
			{ "-1=γ/-1=ν", "ɡ" },
			"ɣ",
		},
	},
}

data["δ"] = {
	["p"] = {
		["cla"] = "d",
		["koi1"] = "d",
		["koi2"] = {
			{ "-1=ν", "d" },
			"ð",
		},
		["byz1"] = {
			{ "-1=ν", "d" },
			"ð",
		},
		["byz2"] = {
			{ "1=δ", "" },
			{ "-1=ν", "d" },
			"ð",
		},
	},
}

data["ϝ"] = {
	["pre"] = {
		{ "1=̓/1=̔", 1 },
		0,
	},
	["p"] = {
		["cla"] = "w",
		["koi1"] = "",
		["koi2"] = "",
		["byz1"] = "",
		["byz2"] = "",
	},
}

data["ϝ̓"] = {
	["p"] = data["ϝ"]["p"]
}

data["ϝ̔"] = {
	["p"] = {
		["cla"] = "ʍ",
		["koi1"] = "(h)",
		["koi2"] = data["ϝ̓"].p.koi2,
		["byz1"] = data["ϝ̓"].p.byz1,
		["byz2"] = data["ϝ̓"].p.byz2,
	},
}

data["ζ"] = {
	["p"] = {
		["cla"] = "zd",
		["koi1"] = "z",
		["koi2"] = "z",
		["byz1"] = "z",
		["byz2"] = {
			{ "1=ζ", "" },
			"z",
		},
	},
}

data["ͱ"] = {
	["p"] = {
		["cla"] = "h",
		["koi1"] = "(h)",
		["koi2"] = "",
		["byz1"] = "",
		["byz2"] = "",
	},
}

data["θ"] = {
	["p"] = {
		["cla"] = "tʰ",
		["koi1"] = "tʰ",
		["koi2"] = "θ",
		["byz1"] = "θ",
		["byz2"] = {
			{ "1=θ", "" },
			"θ",
		},
	},
}

data["ϳ"] = {
	["p"] = {
		["cla"] = "j",
		["koi1"] = "j",
		["koi2"] = "j",
		["byz1"] = "j",
		["byz2"] = "j",
	},
}

data["κ"] = {
	["p"] = {
		["cla"] = {
			{ "1.voiced+1.stop", "ɡ" },
			{ "1.aspirated", "kʰ" },
			"k",
		},
		["koi1"] = {
			{ "1.voiced+1.stop", "ɡ" },
			"k",
		},
		["koi2"] = {
			{ "1=κ", "" },
			{ "1.voiced+1.stop", "ɡ" },
			{ "-1=γ/-1=ν",
				{
					{ "0~preFront", "ɟ" },
					{ "1.unvoiced", "k" },
					"ɡ",
				},
			},
			{ "0~preFront", "c" },
			"k",
		},
		["byz1"] = {
			{ "1=κ", "" },
			{ "1.voiced+1.stop", "ɡ" },
			{ "-1=γ/-1=ν",
				{
					{ "0~preFront", "ɟ" },
					{ "1.unvoiced", "k" },
					"ɡ",
				},
			},
			{ "0~preFront", "c" },
			"k",
		},
		["byz2"] = {
			{ "1=κ", "" },
			{ "1.voiced+1.stop", "ɡ" },
			{ "-1=γ/-1=ν",
				{
					{ "0~preFront", "ɟ" },
					{ "1.unvoiced", "k" },
					"ɡ",
				},
			},
			{ "0~preFront", "c" },
			"k",
		},
	},
}

data["λ"] = {
	["pre"] = {
		{ "1=̓/1=̔", 1 },
		0,
	},
	["p"] = {
		["cla"] = {
			{ "1=λ",
				{
					{ "2=̔", "l̥" },
					"l",
				},
			},
			{ "-1=̔",
				{
					{ "-2=λ", "l̥" },
					"l",
				},
			},
			"l",
		},
		["koi1"] = "l",
		["koi2"] = "l",
		["byz1"] = "l",
		["byz2"] = {
			{ "1=λ", "" },
			"l",
		},
	},
}

data["λ̓"] = {
	["p"] = {
		["cla"] = {
			{ "2=λ",
				{
					{ "3=̔", "l̥" },
					"l",
				},
			},
			"l",
		},
		["koi1"] = data["λ"].p.koi1,
		["koi2"] = data["λ"].p.koi2,
		["byz1"] = data["λ"].p.byz1,
		["byz2"] = {
			{ "2=λ", "" },
			"l",
		},
	},
}

data["λ̔"] = {
	["p"] = {
		["cla"] = "l̥",
		["koi1"] = data["λ̓"].p.koi1,
		["koi2"] = data["λ̓"].p.koi2,
		["byz1"] = data["λ̓"].p.byz1,
		["byz2"] = data["λ̓"].p.byz2,
	},
}

data["μ"] = {
	["p"] = {
		["cla"] = "m",
		["koi1"] = "m",
		["koi2"] = "m",
		["byz1"] = "m",
		["byz2"] = {
			{ "1=μ", "" },
			"m",
		},
	},
}

data["ν"] = {
	["p"] = {
		["cla"] = "n",
		["koi1"] = "n",
		["koi2"] = "n",
		["byz1"] = "n",
		["byz2"] = {
			{ "1=ν", "" },
			"n",
		},
	},
}

data["π"] = {
	["p"] = {
		["cla"] = { 
			{ "1.aspirated", "pʰ" },
			"p",
		},
		["koi1"] = "p",
		["koi2"] = "p",
		["byz1"] = "p",
		["byz2"] = {
			{ "-1=μ",
				{
					{ "1.unvoiced", "p" },
					"b",
				},
			},
			{ "1=π", "" },
			"p",
		},
	},
}

data["ρ"] = {
	["p"] = {
		["cla"] = {
			{ "1=ρ/1=ῥ/-1=ρ/-1=ῤ/-1=ῥ", "r̥" },
			"r",
		},
		["koi1"] = "r",
		["koi2"] = "r",
		["byz1"] = "r",
		["byz2"] = {
			{ "1=ρ/1=ῤ/1=ῥ", "" },
			"r",
		},
	},
}

data["ῤ"] = {
	["p"] = {
		["cla"] = {
			{ "1=ρ/1=ῥ", "r̥" },
			"r",
		},
		["koi1"] = data["ρ"].p.koi1,
		["koi2"] = data["ρ"].p.koi2,
		["byz1"] = data["ρ"].p.byz1,
		["byz2"] = data["ρ"].p.byz2,
	},
}

data["ῥ"] = {
	["p"] = {
		["cla"] = "r̥",
		["koi1"] = data["ῤ"].p.koi1,
		["koi2"] = data["ῤ"].p.koi2,
		["byz1"] = data["ῤ"].p.byz1,
		["byz2"] = data["ῤ"].p.byz2,
	},
}

data["σ"] = {
	["p"] = {
		["cla"] = {
			{ "1.voiced", "z" },
			"s",
		},
		["koi1"] = {
			{ "1.voiced", "z" },
			"s",
		},
		["koi2"] = {
			{ "1.voiced", "z" },
			"s",
		},
		["byz1"] = {
			{ "1.voiced", "z" },
			"s",
		},
		["byz2"] = {
			{ "1=σ", "" },
			{ "1.voiced", "z" },
			"s",
		},
	},
}

data["τ"] = {
	["p"] = {
		["cla"] = {
			{ "1.aspirated", "tʰ" },
			"t",
		},
		["koi1"] = "t",
		["koi2"] = "t",
		["byz1"] = {
			{ "1=ζ", "d" },
			"t",
		},
		["byz2"] = {
			{ "-1=ν/1=ζ", "d" },
			{ "1=τ", "" },
			"t",
		},
	},
}

data["φ"] = {
	["p"] = {
		["cla"] = "pʰ",
		["koi1"] = "pʰ",
		["koi2"] = "ɸ",
		["byz1"] = "f",
		["byz2"] = {
			{ "1=φ", "" },
			"f",
		},
	},
}

data["χ"] = {
	["p"] = {
		["cla"] = "kʰ",
		["koi1"] = "kʰ",
		["koi2"] = {
			{ "1=χ", "" },
			{ "0~preFront", "ç" },
			"x" },
		["byz1"] = {
			{ "1=χ", "" },
			{ "0~preFront", "ç" },
			"x" },
		["byz2"] = {
			{ "1=χ", "" },
			{ "0~preFront", "ç" },
			"x",
		},
	},
}

data["α"] = {
	["pre"] = {
		{ "0~hasMacronBreve",
			{
				{ "1~isIDiphth/1~isUDiphth", 2 },
				1,
			},
		},
		{ "0~isIDiphth/0~isUDiphth", 1 },
		0,
	},
	["p"] = {
		["cla"] = "a",
		["koi1"] = "a",
		["koi2"] = "a",
		["byz1"] = "a",
		["byz2"] = "a",
	},
}

data["ε"] = {
	["pre"] = {
		{ "0~isIDiphth/0~isUDiphth", 1 },
		0,
	},
	["p"] = {
		["cla"] = "e",
		["koi1"] = "e",
		["koi2"] = "e",
		["byz1"] = "e",
		["byz2"] = "e",
	},
}

data["η"] = {
	["pre"] = {
		{ "0~isIDiphth/0~isUDiphth", 1 },
		0,
	},
	["p"] = {
		["cla"] = "ɛ",
		["koi1"] = "e̝",
		["koi2"] = "i",
		["byz1"] = "i",
		["byz2"] = "i",
	},
}

data["ι"] = {
	["p"] = {
		["cla"] = "i",
		["koi1"] = "i",
		["koi2"] = "i",
		["byz1"] = "i",
		["byz2"] = "i",
	},
}

data["ο"] = {
	["pre"] = {
		{ "0~isIDiphth/0~isUDiphth", 1 },
		0,
	},
	["p"] = {
		["cla"] = "o",
		["koi1"] = "o",
		["koi2"] = "o",
		["byz1"] = "o",
		["byz2"] = "o",
	},
}

data["υ"] = {
	["pre"] = {
		{ "0~hasMacronBreve",
			{
				{ "1~isIDiphth", 2 },
				1,
			},
		},
		{ "0~isIDiphth/0~hasSubI", 1 },
		0,
	},
	["p"] = {
		["cla"] = "y",
		["koi1"] = "y",
		["koi2"] = "y",
		["byz1"] = "y",
		["byz2"] = "i",
	},
}

data["ω"] = {
	["pre"] = {
		{ "0~isIDiphth/0~isUDiphth", 1 },
		0,
	},
	["p"] = {
		["cla"] = "ɔ",
		["koi1"] = "o",
		["koi2"] = "o",
		["byz1"] = "o",
		["byz2"] = "o",
	},
}

local categories = {
	[1] = {
		["stop"] = { "β", "γ", "δ", "θ", "κ", "π", "τ", "φ", "χ" },
		["dorsal"] = { "γ", "κ", "χ" },
		["voiced"] = { "β", "γ", "δ", "ζ", "λ", "λ̓", "μ", "ν", "ρ", "ῤ" },
		["unvoiced"] = { "ͱ", "θ", "κ", "λ̔", "π", "ῥ", "σ", "τ", "φ", "χ" },
		["aspirated"] = { "ͱ", "θ", "φ", "χ" },
		["diaer"] = { "ϊ", "ΐ", "ῒ", "ῗ", "ϋ", "ΰ", "ῢ", "ῧ", "ϋͅ", "ΰͅ", "ῢͅ", "ῧͅ" },
		["subi"] = { "ᾳ", "ᾴ", "ᾲ", "ᾷ", "ᾀ", "ᾄ", "ᾂ", "ᾆ", "ᾁ", "ᾅ", "ᾃ", "ᾇ", "ῃ", "ῄ", "ῂ", "ῇ", "ᾐ", "ᾔ", "ᾒ", "ᾖ", "ᾑ", "ᾕ", "ᾓ", "ᾗ", "υͅ", "ύͅ", "ὺͅ", "ῦͅ", "ὐͅ", "ὔͅ", "ὒͅ", "ὖͅ", "ὑͅ", "ὕͅ", "ὓͅ", "ὗͅ", "ϋͅ", "ΰͅ", "ῢͅ", "ῧͅ", "ῳ", "ῴ", "ῲ", "ῷ", "ᾠ", "ᾤ", "ᾢ", "ᾦ", "ᾡ", "ᾥ", "ᾣ", "ᾧ" },
	},
	["type"] = {
		["vowel"] = { "α", "ε", "η", "ι", "ο", "υ", "ω" }, -- Not currently used; if it were, it might need to include all the accented vowel characters.
		["consonant"] = { "β", "γ", "δ", "ζ", "ͱ", "θ", "ϳ", "κ", "λ", "μ", "ν", "π", "ρ", "σ", "τ", "φ", "χ" },
		["long"] = { "ᾱ", "η", "ῑ", "ῡ", "ω" },
		["short"] = { "ᾰ", "ε", "ῐ", "ο", "ῠ" },
		["either"] = { "α", "ι", "υ" },
		["diacritic"] = { diacritics.macron, diacritics.spacing_macron, diacritics.modifier_macron, diacritics.breve, diacritics.spacing_breve, diacritics.rough, diacritics.smooth, diacritics.diaeresis, diacritics.acute, diacritics.grave, diacritics.circum, diacritics.Latin_circum, diacritics.coronis, diacritics.subscript },
	},
	["accent"] = {
		["acute"] = { "ά", "ᾴ", "ἄ", "ᾄ", "ἅ", "ᾅ", "έ", "ἔ", "ἕ", "ή", "ῄ", "ἤ", "ᾔ", "ἥ", "ᾕ", "ί", "ἴ", "ἵ", "ΐ", "ό", "ὄ", "ὅ", "ύ", "ύͅ", "ὔ", "ὔͅ", "ὕ", "ὕͅ", "ΰ", "ΰͅ", "ώ", "ῴ", "ὤ", "ᾤ", "ὥ", "ᾥ" },
		["grave"] = { "ὰ", "ᾲ", "ἂ", "ᾂ", "ἃ", "ᾃ", "ὲ", "ἒ", "ἓ", "ὴ", "ῂ", "ἢ", "ᾒ", "ἣ", "ᾓ", "ὶ", "ἲ", "ἳ", "ῒ", "ὸ", "ὂ", "ὃ", "ὺ", "ὺͅ", "ὒ", "ὒͅ", "ὓ", "ὓͅ", "ῢ", "ῢͅ", "ὼ", "ῲ", "ὢ", "ᾢ", "ὣ", "ᾣ" },
		["circum"] = { "ᾶ", "ᾷ", "ἆ", "ᾆ", "ἇ", "ᾇ", "ῆ", "ῇ", "ἦ", "ᾖ", "ἧ", "ᾗ", "ῖ", "ἶ", "ἷ", "ῗ", "ῦ", "ῦͅ", "ὖ", "ὖͅ", "ὗ", "ὗͅ", "ῧ", "ῧͅ", "ῶ", "ῷ", "ὦ", "ᾦ", "ὧ", "ᾧ" },
	},
	["breath"] = {
		["rough"] = { "ἁ", "ᾁ", "ἅ", "ᾅ", "ἃ", "ᾃ", "ἇ", "ᾇ", "ἑ", "ἕ", "ἓ", "ϝ̔", "ἡ", "ᾑ", "ἥ", "ᾕ", "ἣ", "ᾓ", "ἧ", "ᾗ", "ἱ", "ἵ", "ἳ", "ἷ", "λ̔", "ὁ", "ὅ", "ὃ", "ῥ", "ὑ", "ὑͅ", "ὕ", "ὕͅ", "ὓ", "ὓͅ", "ὗ", "ὗͅ", "ὡ", "ᾡ", "ὥ", "ᾥ", "ὣ", "ᾣ", "ὧ", "ᾧ" },
		["smooth"] = { "ἀ", "ᾀ", "ἄ", "ᾄ", "ἂ", "ᾂ", "ἆ", "ᾆ", "ἐ", "ἔ", "ἒ", "ϝ̓", "ἠ", "ᾐ", "ἤ", "ᾔ", "ἢ", "ᾒ", "ἦ", "ᾖ", "ἰ", "ἴ", "ἲ", "ἶ", "λ̓", "ὀ", "ὄ", "ὂ", "ῤ", "ὐ", "ὐͅ", "ὔ", "ὔͅ", "ὒ", "ὒͅ", "ὖ", "ὖͅ", "ὠ", "ᾠ", "ὤ", "ᾤ", "ὢ", "ᾢ", "ὦ", "ᾦ" },
	},
}

for key1, list in pairs(categories) do
	for key2, letters in pairs(list) do
		if type(key1) == "number" then
			for _, letter in ipairs(letters) do
				if not data[letter] then
					data[letter] = {}
				end
				data[letter][key2] = true
			end
		elseif type(key1) == "string" then
			for _, letter in ipairs(letters) do
				if not data[letter] then
					data[letter] = {}
				end
				data[letter][key1] = key2
			end
		end
	end
end

local rough_breathing = { "h", "(h)" }
local smooth_breathing = { "", "" }

local function get_breathing(breathing)
	return breathing == "rough" and rough_breathing or smooth_breathing
end

local function get_pitch_marks(accent_type, long)
	if accent_type == "acute" then
		if long then
			return acute_on_long_vowel
		else
			return acute_on_short_vowel
		end
	elseif accent_type == "grave" then
		return grave_pitch_mark
	elseif accent_type == "circum" then
		return circumflex_on_long_vowel
	end
	
	return ""
end

local function epsilon(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, false)
	
	return {
			["cla"] = breathing[1] .. "e" .. pitch,
			["koi1"] = breathing[2] .. stress .. "e",
			["koi2"] = stress .. "e",
			["byz1"] = stress .. "e",
			["byz2"] = stress .. "e"
		}
end

for _, letter in ipairs{ "ε", "έ", "ὲ", "ἐ", "ἔ", "ἒ", "ἑ", "ἕ", "ἓ" } do
	local l_data = data[letter]
	l_data.p = epsilon(l_data.breath, l_data.accent)
end

local function omicron(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, false)
	
	return {
			["cla"] = breathing[1] .. "o" .. pitch,
			["koi1"] = breathing[2] .. stress .. "o",
			["koi2"] = stress .. "o",
			["byz1"] = stress .. "o",
			["byz2"] = stress .. "o"
		}
end

for _, letter in ipairs{ "ο", "ό", "ὸ", "ὀ", "ὄ", "ὂ", "ὁ", "ὅ", "ὃ" } do
	local l_data = data[letter]
	l_data.p = omicron(l_data.breath, l_data.accent)
end

local function eta(breathing, accent, iota)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	local offglide = iota and ("i" .. nonsyllabic) or ""
	
	return {
			["cla"] = breathing[1] .. "ɛ" .. pitch .. long .. offglide,
			["koi1"] = breathing[2] .. stress .. "e̝",
			["koi2"] = stress .. "i",
			["byz1"] = stress .. "i",
			["byz2"] = stress .. "i"
		}
end

for _, letter in ipairs{ "η", "ῃ", "ή", "ῄ", "ὴ", "ῂ", "ῆ", "ῇ", "ἠ", "ᾐ", "ἤ", "ᾔ", "ἢ", "ᾒ", "ἦ", "ᾖ", "ἡ", "ᾑ", "ἥ", "ᾕ", "ἣ", "ᾓ", "ἧ", "ᾗ" } do
	local l_data = data[letter]
	l_data.p = eta(l_data.breath, l_data.accent, l_data.subi)
end

local function omega(breathing, accent, iota)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	local offglide = iota and ("i" .. nonsyllabic) or ""
	
	return {
			["cla"] = breathing[1] .. "ɔ" .. pitch .. long .. offglide,
			["koi1"] = breathing[2] .. stress .. "o",
			["koi2"] = stress .. "o",
			["byz1"] = stress .. "o",
			["byz2"] = stress .. "o"
		}
end

for _, letter in ipairs{ "ω", "ῳ", "ώ", "ῴ", "ὼ", "ῲ", "ῶ", "ῷ", "ὠ", "ᾠ", "ὤ", "ᾤ", "ὢ", "ᾢ", "ὦ", "ᾦ", "ὡ", "ᾡ", "ὥ", "ᾥ", "ὣ", "ᾣ", "ὧ", "ᾧ" } do
	local l_data = data[letter]
	l_data.p = omega(l_data.breath, l_data.accent, l_data.subi)
end

local function alpha(breathing, accent, iota, isLong)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, isLong)
	local length = (isLong or iota or accent == "circum") and long or ""
	local offglide = iota and ("i" .. nonsyllabic) or ""
	
	return {
			["cla"] = breathing[1] .. "a" .. pitch .. length .. offglide,
			["koi1"] = breathing[2] .. stress .. "a",
			["koi2"] = stress .. "a",
			["byz1"] = stress .. "a",
			["byz2"] = stress .. "a"
		}
end

for _, letter in ipairs{ "α", "ᾳ", "ά", "ᾴ", "ὰ", "ᾲ", "ᾶ", "ᾷ", "ἀ", "ᾀ", "ἄ", "ᾄ", "ἂ", "ᾂ", "ἆ", "ᾆ", "ἁ", "ᾁ", "ἅ", "ᾅ", "ἃ", "ᾃ", "ἇ", "ᾇ" } do
	local l_data = data[letter]
	l_data.p = alpha(l_data.breath, l_data.accent, l_data.subi)
	if not (l_data.subi or l_data.accent == "circum") then
		if not l_data.pre then
			l_data.pre = pre_hasMacronBreve
		end
		data[letter .. breve] = { p = l_data.p }
		data[letter .. macron] = { p = alpha(l_data.breath, l_data.accent, false, true) }
	end
end

local function iota(breathing, accent, isLong)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, isLong)
	local length = (isLong or accent == "circum") and long or ""
	
	return {
			["cla"] = breathing[1] .. "i" .. pitch .. length,
			["koi1"] = breathing[2] .. stress .. "i",
			["koi2"] = stress .. "i",
			["byz1"] = stress .. "i",
			["byz2"] = stress .. "i"
		}
end

local function ai(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
			["cla"] = breathing[1] .. "a" .. pitch .. "i" .. nonsyllabic,
			["koi1"] = breathing[2] .. stress .. "ɛ",
			["koi2"] = stress .. "ɛ",
			["byz1"] = stress .. "e",
			["byz2"] = stress .. "e"
		}
end

local function ei(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
			["cla"] = breathing[1] .. "e" .. pitch .. long,
			["koi1"] = breathing[2] .. stress .. "i",
			["koi2"] = stress .. "i",
			["byz1"] = stress .. "i",
			["byz2"] = stress .. "i"
		}
end

local function oi(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
			["cla"] = breathing[1] .. "o" .. pitch .. "i" .. nonsyllabic,
			["koi1"] = breathing[2] .. stress .. "y",
			["koi2"] = stress .. "y",
			["byz1"] = stress .. "y",
			["byz2"] = stress .. "i"
		}
end

local function ui(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
			["cla"] = breathing[1] .. "y" .. pitch .. long,
			["koi1"] = breathing[2] .. stress .. "y",
			["koi2"] = stress .. "y",
			["byz1"] = stress .. "y",
			["byz2"] = stress .. "i"
		}
end

for _, letter in ipairs{ "ι", "ί", "ὶ", "ῖ", "ἰ", "ἴ", "ἲ", "ἶ", "ἱ", "ἵ", "ἳ", "ἷ", "ϊ", "ΐ", "ῒ", "ῗ" } do
	local l_data = data[letter]
	l_data.p = iota(l_data.breath, l_data.accent)
	if l_data.accent ~= "circum" then
		l_data.pre = pre_hasMacronBreve
		data[letter .. breve] = { p = l_data.p }
		data[letter .. macron] = { p = iota(l_data.breath, l_data.accent, true) }
	end
	if not l_data.diar then
		local ai_data = { p = ai(l_data.breath, l_data.accent) }
		data["α" .. letter] = ai_data
		data["α" .. breve .. letter] = ai_data
		data["α" .. macron .. letter] = { p = alpha(l_data.breath, l_data.accent, true, true) }
		data["ε" .. letter] = { p = ei(l_data.breath, l_data.accent) }
		data["η" .. letter] = { p = eta(l_data.breath, l_data.accent, true) }
		data["ο" .. letter] = { p = oi(l_data.breath, l_data.accent) }
		local ui_data = { p = ui(l_data.breath, l_data.accent) }
		data["υ" .. letter] = ui_data
		data["υ" .. breve .. letter] = ui_data
		data["υ" .. macron .. letter] = ui_data
		data["ϋ" .. letter] = ui_data
		data["ϋ" .. breve .. letter] = ui_data
		data["ϋ" .. macron .. letter] = ui_data
		data["ω" .. letter] = { p = omega(l_data.breath, l_data.accent, true) }
	end
end

local function upsilon(breathing, accent, iota, isLong)
	if iota then
		return ui(breathing, accent)
	end
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, isLong)
	local length = (isLong or accent == "circum") and long or ""
	
	return {
			["cla"] = breathing[1] .. "y" .. pitch .. length,
			["koi1"] = breathing[2] .. stress .. "y",
			["koi2"] = stress .. "y",
			["byz1"] = stress .. "y",
			["byz2"] = stress .. "i"
		}
end

local function au(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
		["cla"] = breathing[1] .. "a" .. pitch .. "u" .. nonsyllabic,
		["koi1"] = {
			{ "2=σ+3.voiced", breathing[2] .. stress .. "a" .. "w" },
			{ "2.unvoiced", breathing[2] .. stress .. "a" .. "ʍ" },
			breathing[2] .. stress .. "a" .. "w",
		},
		["koi2"] = {
			{ "2=σ+3.voiced", stress .. "aβ" },
			{ "2.unvoiced", stress .. "aɸ" },
			stress .. "aβ",
		},
		["byz1"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "av" },
			{ "2.unvoiced", stress .. "af" },
			stress .. "av",
		},
		["byz2"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "av" },
			{ "2.unvoiced", stress .. "af" },
			stress .. "av",
		},
	}
end

local function aau(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
		["cla"] = breathing[1] .. "a" .. pitch .. "ːu" .. nonsyllabic,
		["koi1"] = {
			{ "2=σ+3.voiced", breathing[2] .. stress .. "a" .. "w" },
			{ "2.unvoiced", breathing[2] .. stress .. "a" .. "ʍ" },
			breathing[2] .. stress .. "a" .. "w",
		},
		["koi2"] = {
			{ "2=σ+3.voiced", stress .. "aβ" },
			{ "2.unvoiced", stress .. "aɸ" },
			stress .. "aβ",
		},
		["byz1"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "av" },
			{ "2.unvoiced", stress .. "af" },
			stress .. "av",
		},
		["byz2"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "av" },
			{ "2.unvoiced", stress .. "af" },
			stress .. "av",
		},
	}
end

local function eu(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
		["cla"] = breathing[1] .. "e" .. pitch .. "u" .. nonsyllabic,
		["koi1"] = {
			{ "2=σ+3.voiced", breathing[2] .. stress .. "e" .. "w" },
			{ "2.unvoiced", breathing[2] .. stress .. "e" .. "ʍ" },
			breathing[2] .. stress .. "e" .. "w",
		},
		["koi2"] = {
			{ "2=σ+3.voiced", stress .. "eβ" },
			{ "2.unvoiced", stress .. "eɸ" },
			stress .. "eβ",
		},
		["byz1"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "ev" },
			{ "2.unvoiced", stress .. "ef" },
			stress .. "ev",
		},
		["byz2"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "ev" },
			{ "2.unvoiced", stress .. "ef" },
			stress .. "ev",
		},
	}
end

local function hu(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
		["cla"] = breathing[1] .. "ɛ" .. pitch .. "ːu" .. nonsyllabic,
		["koi1"] = {
			{ "2=σ+3.voiced", breathing[2] .. stress .. "e̝" .. "w" },
			{ "2.unvoiced", breathing[2] .. stress .. "e̝" .. "ʍ" },
			breathing[2] .. stress .. "e̝" .. "w",
		},
		["koi2"] = {
			{ "2=σ+3.voiced", stress .. "iβ" },
			{ "2.unvoiced", stress .. "iɸ" },
			stress .. "iβ",
		},
		["byz1"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "iv" },
			{ "2.unvoiced", stress .. "if" },
			stress .. "iv",
		},
		["byz2"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "iv" },
			{ "2.unvoiced", stress .. "if" },
			stress .. "iv",
		},
	}
end

local function ou(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
			["cla"] = breathing[1] .. "u" .. pitch .. long,
			["koi1"] = breathing[2] .. stress .. "u",
			["koi2"] = stress .. "u",
			["byz1"] = stress .. "u",
			["byz2"] = stress .. "u"
		}
end

local function wu(breathing, accent)
	local breathing = get_breathing(breathing)
	local stress = accent and stress_mark or ""
	local pitch = get_pitch_marks(accent, true)
	
	return {
		["cla"] = breathing[1] .. "ɔ" .. pitch .. "ːu" .. nonsyllabic,
		["koi1"] = {
			{ "2=σ+3.voiced", breathing[2] .. stress .. "o" .. "w" },
			{ "2.unvoiced", breathing[2] .. stress .. "o" .. "ʍ" },
			breathing[2] .. stress .. "o" .. "w",
		},
		["koi2"] = {
			{ "2=σ+3.voiced", stress .. "oβ" },
			{ "2.unvoiced", stress .. "oɸ" },
			stress .. "oβ",
		},
		["byz1"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "ov" },
			{ "2.unvoiced", stress .. "of" },
			stress .. "ov",
		},
		["byz2"] = {
			{ "2=σ+3.voiced/2=τ+3=ζ", stress .. "ov" },
			{ "2.unvoiced", stress .. "of" },
			stress .. "ov",
		},
	}
end

for _, letter in ipairs{ "υ", "υͅ", "ύ", "ύͅ", "ὺ", "ὺͅ", "ῦ", "ῦͅ", "ὐ", "ὐͅ", "ὔ", "ὔͅ", "ὒ", "ὒͅ", "ὖ", "ὖͅ", "ὑ", "ὑͅ", "ὕ", "ὕͅ", "ὓ", "ὓͅ", "ὗ", "ὗͅ", "ϋ", "ϋͅ", "ΰ", "ΰͅ", "ῢ", "ῢͅ", "ῧ", "ῧͅ" } do
	local l_data = data[letter]
	l_data.p = upsilon(l_data.breath, l_data.accent, l_data.subi)
	if not l_data.subi then
		if l_data.accent == "circum" then
			l_data.pre = pre_hasSubI
		else
			if letter == "ϋ" then
				l_data.pre = data["υ"].pre
			elseif letter ~= "υ" then
				l_data.pre = pre_hasMacronBreve_hasSubI
			end
			data[letter .. breve] = { p = l_data.p }
			data[letter .. macron] = { p = upsilon(l_data.breath, l_data.accent, false, true) }
		end
		if not l_data.diar then
			local au_data = { p = au(l_data.breath, l_data.accent) }
			data["α" .. letter] = au_data
			data["α" .. breve .. letter] = au_data
			data["α" .. macron .. letter] = { p = aau(l_data.breath, l_data.accent) }
			data["ε" .. letter] = { p = eu(l_data.breath, l_data.accent) }
			data["η" .. letter] = { p = hu(l_data.breath, l_data.accent) }
			data["ο" .. letter] = { p = ou(l_data.breath, l_data.accent) }
			data["ω" .. letter] = { p = wu(l_data.breath, l_data.accent) }
		end
	end
end

data["chars"] = {
	["cons"] = "bɡŋdzklmnprstβðɣɸθxfvɟʝcçwʍj",
	["vowel"] = "aeiouyɛɔ",
	["diacritic"] = high .. low .. midHigh .. midLow .. highMid .. long .. aspirated .. voiceless .. nonsyllabic .. rising .. falling,
	["liquid"] = "rln",
	["obst"] = "bɡdkptβðɣɸθxfv",
	["frontDiphth"] = "[αο]ι",
	["frontVowel"] = "ιηευ",
	["iDiaer"] = "ϊΐῒῗ",
	["long"] = "ηω",
	["short"] = "εο",
	["ambig"] = "αιυ",
	["uDiphth"] = "αᾰᾱεηοω", -- first members for diphthongs ending in "υ"
	["iDiphth"] = "αᾰᾱεηουῠῡω", -- first members for diphthongs ending in "ι"
	["Greekdiacritic"] = m_utils_data.all,
	["Greekconsonant"] = m_utils_data.consonants
}
data.chars.frontDiphthong = data.chars.frontDiphth

return data