Module:number list/data/yo

local export = {}

export.additional_number_types = { { key = "counting", display = "Counting", after = "cardinal" }, { key = "adjectival", display = "Adjectival", after = "counting" }, }

local numbers = {} export.numbers = numbers

-- Delete any number types that don't apply. --[[ template numbers[1] = {	cardinal = "",	counting = "",	adjectival = "",	ordinal = "",	adverbial = "",	distributive = "",	collective = "",	fractional = "", }

template past 4: numbers[5] = { cardinal = "", counting = "", } ]]

local adjectival_prefix = "m" local ordinal_prefix = "k" local adverbial_prefix = "ẹ̀ẹ̀" local fractional_prefix = "ìdá" local low_tones = { a = "àà", e = "èè", ['ẹ'] = "ẹ̀ẹ̀", i = "ìì", o = "òò", ['ọ'] = "ọ̀ọ̀", u = "ùù", }

numbers[0] = { cardinal = "òdo", counting = {"òdo", "oódo"} }

numbers[1] = { cardinal = {"ọ̀kan", "ení"}, counting = "oókan", adjectival = {"kan", "méní"}, ordinal = {"kìíní", "kìn-ín-ní"}, adverbial = adverbial_prefix .. "kan", distributive = "ọ̀kọ̀ọ̀kan", collective = "ọ̀kọ̀ọ̀kan", }

numbers[2] = { cardinal = "èjì", counting = "eéjì", fractional = "ìdajì", }

numbers[3] = { cardinal = "ẹ̀ta", counting = "ẹẹ́ta", fractional = "ìdata", }

numbers[4] = { cardinal = "ẹ̀rin", counting = "ẹẹ́rin", fractional = "ìdarin", }

numbers[5] = { cardinal = "àrún", counting = "aárùn-ún", }

numbers[6] = { cardinal = "ẹ̀fà", counting = "ẹẹ́fà", }

numbers[7] = { cardinal = "èje", counting = "eéje", }

numbers[8] = { cardinal = "ẹ̀jọ", counting = "ẹẹ́jọ", }

numbers[9] = { cardinal = "ẹ̀sán", counting = "ẹẹ́sàn-án", }

numbers[10] = { cardinal = "ẹ̀wá", counting = "ẹẹ́wàá", }

numbers[20] = { cardinal = "ogún", counting = "ogún", adjectival = "ogún", ordinal = "ogún", adverbial = "ìgbà ogún", distributive = "ogoogún", collective = "gbogbo ogún", fractional = "ìdá ogún", }

numbers[30] = { cardinal = "ọgbọ̀n", counting = "ọgbọ̀n", adjectival = "ọgbọ̀n", ordinal = "ọgbọ̀n", adverbial = "ìgbà ọgbọ̀n", distributive = "ọgbọọgbọ̀n", collective = "gbogbo ọgbọ̀n", fractional = "ìdá ọgbọ̀n", }

numbers[200] = { cardinal = "igba", counting = "igba", adjectival = "igba", ordinal = "igba", adverbial = "ìgbà igba", distributive = "igba igba", }

local function create_adjectival(number) if number > 10 then last_digit = math.floor(number%10) if last_digit == 1 or last_digit == 9 then return adjectival_prefix .. "ọ́" .. mw.ustring.sub(numbers[number].counting, 3) end end return adjectival_prefix .. mw.ustring.sub(numbers[number].counting, 2) end

local function create_ord_adv_sub(number) base_form = numbers[number].counting if number > 10 then last_digit = math.floor(number%10) if last_digit == 1 or last_digit == 9 then base_form = "ọọ́" .. mw.ustring.sub(base_form, 3) end end if mw.ustring.sub(base_form, 3, 3) == "́" then return mw.ustring.sub(base_form, 1, 1) .. mw.ustring.sub(base_form, 4) else return mw.ustring.sub(base_form, 1, 1) .. mw.ustring.sub(base_form, 3) end end

local function create_collective(number) str = mw.ustring.sub(numbers[number].counting, 1, 1) if number > 10 then last_digit = math.floor(number%10) if last_digit == 1 or last_digit == 9 then str = "ọ" end end s = low_tones[str] if mw.ustring.sub(numbers[number].adjectival, 3, 3) == "́" then return mw.ustring.sub(numbers[number].adjectival, 1, 4) .. s .. mw.ustring.sub(numbers[number].adjectival, 4) else return mw.ustring.sub(numbers[number].adjectival, 1, 3) .. s .. mw.ustring.sub(numbers[number].adjectival, 3) end end

local function get_cardinal(number) return numbers[number].cardinal end

local function get_adjectival(number) return numbers[number].adjectival end

local pre_teens = "lá" local minus = "dín" local plus = "lé" local last_start = { ['à'] = "láà", i = "ní", o = "ló", ['ọ'] = "lọ́", }

local replace_card = { ["1"] = "ọ̀kàn", ["2"] = "èjì", ["3"] = "ẹ̀tà", ["4"] = "ẹ̀rìn", ["5"] = "àrún", }

local replace_count = { ["1"] = "oókàn", ["2"] = "eéjì", ["3"] = "ẹẹ́tà", ["4"] = "ẹẹ́rìn", ["5"] = "aárùn-ún", }

for number = 11, 14 do	base_num = number - 10 numbers[number] = { cardinal = replace_card[tostring(base_num)] .. pre_teens, counting = replace_count[tostring(base_num)] .. pre_teens, } end

for number = 15, 19 do	base_num = 10 - (number - 10) numbers[number] = { cardinal = replace_card[tostring(base_num)] .. minus .. "lógún", counting = replace_count[tostring(base_num)] .. minus .. "lógún", } end

for number = 2, 19 do	str = create_ord_adv_sub(number) numbers[number].adjectival = create_adjectival(number) numbers[number].ordinal = ordinal_prefix .. str numbers[number].distributive = get_adjectival(number) .. " " .. get_adjectival(number) numbers[number].adverbial = adverbial_prefix .. adjectival_prefix .. str numbers[number].collective = create_collective(number) end

for number = 5, 19 do numbers[number].fractional = fractional_prefix .. get_adjectival(number) end

local twenties_endings = { ['2'] = "jì", ['3'] = "ta", ['4'] = "rin", ['5'] = "rùn-ún", ['6'] = "fà", ['7'] = "je", ['8'] = "jọ", ['9'] = "sàn-án", ['10'] = "wàá", }

-- Creates base form for 20s local function create_twenties(number) str = numbers[number].counting if mw.ustring.sub(str, 1, 1) == "e" then return "ogó" .. twenties_endings[tostring(number)] else return "ọgọ́" .. twenties_endings[tostring(number)] end end

-- Creates base form for 10s in-between 20s local function create_mid_twenties(number) str = numbers[number].counting if mw.ustring.sub(str, 1, 1) == "o" then return "àádó" .. twenties_endings[tostring(number / 20)] else return "àádọ́" .. twenties_endings[tostring(number / 20)] end end

-- Add cardinals & counting numbers for 21-185 for i = 1, 10 do	local twenties = i * 20 local twenties_cardinal local mid_twenties if i ~= 1 then twenties_cardinal = create_twenties(i) if i ~= 10 then numbers[twenties] = { cardinal = twenties_cardinal, counting = twenties_cardinal, adjectival = twenties_cardinal, ordinal = twenties_cardinal, adverbial = 'ìgbà' .. " " .. twenties_cardinal, distributive = twenties_cardinal .. " " .. twenties_cardinal, }		end if i ~= 2 and i ~= 10 then mid_twenties = create_mid_twenties(twenties) numbers[twenties - 10] = { cardinal = mid_twenties, counting = mid_twenties, adjectival = mid_twenties, ordinal = mid_twenties, adverbial = 'ìgbà' .. " " .. mid_twenties, distributive = mid_twenties .. " " .. mid_twenties, }		elseif i == 10 then mid_twenties = "àádọ́wàá" numbers[twenties - 10] = { cardinal = mid_twenties, counting = mid_twenties, adjectival = mid_twenties, ordinal = mid_twenties, adverbial = 'ìgbà' .. " " .. mid_twenties, distributive = mid_twenties .. " " .. mid_twenties, }		else mid_twenties = numbers[twenties - 10].cardinal end end if i ~= 1 then for ones = -15, -11 do 			base_num = -10 - ones check = mw.ustring.sub(mid_twenties, 1, 1) numbers[twenties + ones] = { cardinal = replace_card[tostring(base_num)] .. minus .. last_start[check] .. mw.ustring.sub(mid_twenties, 2), counting = replace_count[tostring(base_num)] .. minus .. last_start[check] .. mw.ustring.sub(mid_twenties, 2), }			numbers[twenties + ones].adjectival = create_adjectival(twenties + ones) end for ones = -9, -6 do			base_num = 10 + ones check = mw.ustring.sub(mid_twenties, 1, 1) numbers[twenties + ones] = { cardinal = replace_card[tostring(base_num)] .. plus .. last_start[check] .. mw.ustring.sub(mid_twenties, 2), counting = replace_count[tostring(base_num)] .. plus .. last_start[check] .. mw.ustring.sub(mid_twenties, 2), }			numbers[twenties + ones].adjectival = create_adjectival(twenties + ones) end end twenties_cardinal = numbers[twenties].cardinal for ones = -5, -1 do		base_num = 0 - ones check = mw.ustring.sub(twenties_cardinal, 1, 1) numbers[twenties + ones] = { cardinal = replace_card[tostring(base_num)] .. minus .. last_start[check] .. mw.ustring.sub(twenties_cardinal, 2), counting = replace_count[tostring(base_num)] .. minus .. last_start[check] .. mw.ustring.sub(twenties_cardinal, 2) }		numbers[twenties + ones].adjectival = create_adjectival(twenties + ones) end if i ~= 10 then for ones = 1, 4 do			base_num = ones check = mw.ustring.sub(twenties_cardinal, 1, 1) numbers[twenties + ones] = { cardinal = replace_card[tostring(base_num)] .. plus .. last_start[check] .. mw.ustring.sub(twenties_cardinal, 2), counting = replace_count[tostring(base_num)] .. plus .. last_start[check] .. mw.ustring.sub(twenties_cardinal, 2) }			numbers[twenties + ones].adjectival = create_adjectival(twenties + ones) end end end

numbers[300] = { cardinal = "ọ̀ọ́dúnrún", counting = "ọ̀ọ́dúnrún", adjectival = "ọ̀ọ́dúnrún", ordinal = "ọ̀ọ́dúnrún", adverbial = "ìgbà ọ̀ọ́dúnrún", distributive = "ọ̀ọ́dúnrún ọ̀ọ́dúnrún", }

numbers[400] = { cardinal = "irinwó", counting = "irinwó", adjectival = "irinwó", ordinal = "irinwó", adverbial = "ìgbà irinwó", distributive = "irinwó irinwó", }

numbers[2000] = { cardinal = {"ẹgbàá","ẹgbẹ̀wàá"}, counting = {"ẹgbàá", "ẹgbẹ̀wàá"}, adjectival = {"ẹgbàá", "ẹgbẹ̀wàá"}, ordinal = {"ẹgbàá", "ẹgbẹ̀wàá"}, } numbers[20000] = { cardinal = "ọ̀kẹ́", counting = "ọ̀kẹ́ kan", }

-- Endings for the 200s local two_hundreds_endings = { ['3'] = "ta", ['4'] = "rin", ['5'] = "rún", ['6'] = "fà", ['7'] = "je", ['8'] = "jọ", ['9'] = "sán", ['10'] = "wá", ['11'] = "ọ̀kànlá", ['12'] = "jìlá", ['13'] = "tàlá", ['14'] = "rìnlá", ['15'] = "ẹ́dógún", ['16'] = "rìndínlógún", ['17'] = "tàdínlógún", ['18'] = "jìdínlógún", ['19'] = "ọ̀kàndínlógún", }

-- Creates base form for 200s local function create_two_hundreds(number) str = numbers[number].counting if mw.ustring.sub(str, 1, 1) == "e" then return "egbè" .. two_hundreds_endings[tostring(number)] elseif mw.ustring.sub(str, 1, 1) == "o" then return "ẹgb" .. two_hundreds_endings[tostring(number)] else return "ẹgbẹ̀" .. two_hundreds_endings[tostring(number)] end end

-- Creates base form for 100s in-between 200s local function create_mid_two_hundreds(number) str = numbers[number].counting if mw.ustring.sub(str, 1, 1) == "e" then return "èédé" .. mw.ustring.sub(str, 2) else return "ẹ̀ẹ́dẹ́" .. mw.ustring.sub(str, 2) end end

-- Creates 100s from 200-2000 for i = 3, 10 do	local two_hundreds = i * 200 local mid_two_hundreds if i ~= 10 then two_hundreds_cardinals = create_two_hundreds(i) numbers[two_hundreds] = { cardinal = two_hundreds_cardinals, counting = two_hundreds_cardinals, adjectival = two_hundreds_cardinals, ordinal = two_hundreds_cardinals, }	end if i ~= 10 then mid_two_hundreds = create_mid_two_hundreds(two_hundreds) numbers[two_hundreds - 100] = { cardinal = mid_two_hundreds, counting = mid_two_hundreds, adjectival = mid_two_hundreds, ordinal = mid_two_hundreds, }	else mid_two_hundreds = "ẹ̀ẹ́dẹ́gbẹ̀wàá" numbers[two_hundreds - 100] = { cardinal = mid_two_hundreds, counting = mid_two_hundreds, adjectival = mid_two_hundreds, ordinal = mid_two_hundreds, }	end end

-- Creates base form for 2000s local function create_two_thousands(number) return "ẹgbàa" .. twenties_endings[tostring(number)] end

-- Creates base form for 1000s in-between 2000s local function create_mid_two_thousands(number) str = numbers[number].counting return "ẹ̀ẹ́dẹ́" .. mw.ustring.sub(str, 2) end

-- Creates 1000s from 2000-20000 for i = 2, 10 do	local two_thousands = i * 2000 local mid_two_thousands if i ~= 10 then two_thousands_cardinals = create_two_thousands(i) numbers[two_thousands] = { cardinal = two_thousands_cardinals, counting = two_thousands_cardinals, adjectival = two_thousands_cardinals, ordinal = two_thousands_cardinals, }	end if i ~= 10 then mid_two_thousands = create_mid_two_thousands(two_thousands) numbers[two_thousands - 1000] = { cardinal = mid_two_thousands, counting = mid_two_thousands, adjectival = mid_two_thousands, ordinal = mid_two_thousands, }	else two_thousands_cardinals = create_two_thousands(i) x = numbers[two_thousands].cardinal y = numbers[two_thousands].counting numbers[two_thousands] = { cardinal = {x, two_thousands_cardinals}, counting = {y, two_thousands_cardinals}, adjectival = {y, two_thousands_cardinals}, ordinal = two_thousands_cardinals, }		mid_two_thousands = "ẹ̀ẹ́dẹ́" .. mw.ustring.sub(two_thousands_cardinals, 2) numbers[two_thousands - 1000] = { cardinal = mid_two_thousands, counting = mid_two_thousands, adjectival = mid_two_thousands, ordinal = mid_two_thousands, }	end end

-- Creates 100s from 2000-3800 for i = 11, 19 do	local two_hundreds = i * 200 local mid_two_hundreds if i ~= 15 then two_hundreds_cardinals = create_two_hundreds(i) numbers[two_hundreds] = { cardinal = two_hundreds_cardinals, counting = two_hundreds_cardinals, adjectival = two_hundreds_cardinals, ordinal = two_hundreds_cardinals, }	end if i ~= 15 then mid_two_hundreds = create_mid_two_hundreds(two_hundreds) numbers[two_hundreds - 100] = { cardinal = mid_two_hundreds, counting = mid_two_hundreds, adjectival = mid_two_hundreds, ordinal = mid_two_hundreds, }	else two_hundreds_cardinals = create_two_hundreds(i) x = numbers[two_hundreds].cardinal numbers[two_hundreds] = { cardinal = {x, two_hundreds_cardinals}, counting = {x, two_hundreds_cardinals}, adjectival = {x, two_hundreds_cardinals}, ordinal = {x, two_hundreds_cardinals}, }		mid_two_hundreds = "ẹ̀ẹ́dẹ́" .. mw.ustring.sub(two_hundreds_cardinals, 2) numbers[two_hundreds - 100] = { cardinal = mid_two_hundreds, counting = mid_two_hundreds, adjectival = mid_two_hundreds, ordinal = mid_two_hundreds, }	end end

numbers[15] = { cardinal = {numbers[15].cardinal, "ẹ̀ẹ́dógún"}, counting = {numbers[15].counting, "ẹ̀ẹ́dógún"}, adjectival = {numbers[15].adjectival, "mẹ́ẹ̀ẹ́dógún"}, ordinal = {numbers[15].ordinal, "kẹẹ́dógún"}, }

num_5000 = numbers[5000].cardinal numbers[5000] = { cardinal = {num_5000, "ẹgbẹ̀ẹ́dọ́gbọ̀n"}, counting = {num_5000, "ẹgbẹ̀ẹ́dọ́gbọ̀n"}, adjectival = {num_5000, "ẹgbẹ̀ẹ́dọ́gbọ̀n"}, ordinal = {num_5000, "ẹgbẹ̀ẹ́dọ́gbọ̀n"}, }

numbers[100000] = { cardinal = "ọ̀kẹ́ márùn-ún", counting = "ọ̀kẹ́ márùn-ún", adjectival = "ọ̀kẹ́ márùn-ún", ordinal = "ọ̀kẹ́ márùn-ún", }

numbers[1000000] = { cardinal = {"àádọ́ta ọ̀kẹ́", "ẹgbẹ̀ẹgbẹ̀rún", "mílíọ̀nù"}, counting = {"àádọ́ta ọ̀kẹ́", "ẹgbẹ̀ẹgbẹ̀rún", "mílíọ̀nù kan"}, adjectival = {"àádọ́ta ọ̀kẹ́", "ẹgbẹ̀ẹgbẹ̀rún", "mílíọ̀nù kan"}, ordinal = {"àádọ́ta ọ̀kẹ́", "ẹgbẹ̀ẹgbẹ̀rún", "mílíọ̀nù kan"}, }

numbers[1000000000] = { cardinal = {"bílíọ̀nù"}, counting = {"bílíọ̀n kan"}, adjectival = {"bílíọ̀n kan"}, ordinal = {"bílíọ̀n kan"}, }

numbers[1000000000000] = { cardinal = {"tírílíọ̀nù"}, counting = {"tírílíọ̀nù kan"}, adjectival = {"tírílíọ̀nù kan"}, ordinal = {"tírílíọ̀nù kan"}, } return export