Jump to content

မေႃႇၵျူး:grc-link/data

လုၵ်ႉတီႈ ဝိၵ်ႇသျိၼ်ႇၼရီႇ မႃး
ထႅမ်းပလဵတ်ႉ ဢၼ်ၼႆႉ တိုၵ်ႉလူဝ်ႇ ၽိုၼ်ၵႅမ်မိုဝ်းမၼ်း။
ၶႅၼ်းတေႃႈ တႅမ်ႈပၼ် ၽိုၼ်ၵႅမ်မိုဝ်း ထႅမ်းပလဵတ်ႉ ဢၼ်ၼႆႉ သေ ၼႄပၼ် လွင်ႈယိူင်းဢၢၼ်း လႄႈ လၢႆးၸႂ်ႉတိုဝ်း ၵႃႈတီႈ ၼႃႈလိၵ်ႈ ၽိုၼ်ၵႅမ်မိုဝ်း သေၵမ်း။

local make_auto_subtabler = require("Module:auto-subtable")

local content = mw.title.new("Appendix:Ancient Greek endings"):getContent()

local endings = {}

-- Find entries for endings marked by the syntax "; [[...]]".
-- Store them in a table.
for anchor in content:gmatch("\n; %[%[([^%]]+)%]%]") do
	if anchor:find("[\128-\255]") then
		for suffix in anchor:gmatch("%-[^%s,]+") do
			endings[suffix] = true
		end
	end
end

local shares_ending = make_auto_subtabler()

-- The actual purpose of this data module:
-- Check if each ending ends with the characters of any smaller endings, by
-- snipping off progressively larger pieces of the ending and comparing them to
-- all other endings.
-- If so, store the ending in an array indexed by the shorter ending.
-- For instance, -εσθαι ends with the characters of -αι and -σθαι.
for ending in pairs(endings) do
	for i = 1, mw.ustring.len(ending) - 2 do -- Ignore the first two characters because of the hyphen.
		local sub_ending = "-" .. mw.ustring.sub(ending, -i)
		if endings[sub_ending] then
			table.insert(shares_ending[sub_ending], ending)
		end
	end
end

shares_ending:un_auto_subtable()

return { shares_ending = shares_ending }