This module contains data on various types of numbers in Yoruba.
local export = {}
export.additional_number_types = {
{ key = "counting", display = "]", after = "cardinal" },
{ key = "adjectival", display = "]", after = "counting" },
}
local numbers = {}
export.numbers = numbers
-- Delete any number types that don't apply.
--[[ template
numbers = {
cardinal = "",
counting = "",
adjectival = "",
ordinal = "",
adverbial = "",
distributive = "",
collective = "",
fractional = "",
}
template past 4:
numbers = {
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 = {
cardinal = "òdo",
counting = {"òdo", "oódo"}
}
numbers = {
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 = {
cardinal = "èjì",
counting = "eéjì",
fractional = "ìdajì",
}
numbers = {
cardinal = "ẹ̀ta",
counting = "ẹẹ́ta",
fractional = "ìdata",
}
numbers = {
cardinal = "ẹ̀rin",
counting = "ẹẹ́rin",
fractional = "ìdarin",
}
numbers = {
cardinal = "àrún",
counting = "aárùn-ún",
}
numbers = {
cardinal = "ẹ̀fà",
counting = "ẹẹ́fà",
}
numbers = {
cardinal = "èje",
counting = "eéje",
}
numbers = {
cardinal = "ẹ̀jọ",
counting = "ẹẹ́jọ",
}
numbers = {
cardinal = "ẹ̀sán",
counting = "ẹẹ́sàn-án",
}
numbers = {
cardinal = "ẹ̀wá",
counting = "ẹẹ́wàá",
}
numbers = {
cardinal = "ogún",
counting = "ogún",
adjectival = "ogún",
ordinal = "ogún",
adverbial = "] ]",
distributive = "ogoogún",
collective = "] ]",
fractional = "ìdá ogún",
}
numbers = {
cardinal = "ọgbọ̀n",
counting = "ọgbọ̀n",
adjectival = "ọgbọ̀n",
ordinal = "ọgbọ̀n",
adverbial = "] ]",
distributive = "ọgbọọgbọ̀n",
collective = "] ]",
fractional = "ìdá ọgbọ̀n",
}
numbers = {
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.counting, 3)
end
end
return adjectival_prefix .. mw.ustring.sub(numbers.counting, 2)
end
local function create_ord_adv_sub(number)
base_form = numbers.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.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
if mw.ustring.sub(numbers.adjectival, 3, 3) == "́" then
return mw.ustring.sub(numbers.adjectival, 1, 4) .. s .. mw.ustring.sub(numbers.adjectival, 4)
else
return mw.ustring.sub(numbers.adjectival, 1, 3) .. s .. mw.ustring.sub(numbers.adjectival, 3)
end
end
local function get_cardinal(number)
return numbers.cardinal
end
local function get_adjectival(number)
return numbers.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 = {
= "ọ̀kàn",
= "èjì",
= "ẹ̀tà",
= "ẹ̀rìn",
= "àrún",
}
local replace_count = {
= "oókàn",
= "eéjì",
= "ẹẹ́tà",
= "ẹẹ́rìn",
= "aárùn-ún",
}
for number = 11, 14 do
base_num = number - 10
numbers = {
cardinal = replace_card .. pre_teens,
counting = replace_count .. pre_teens,
}
end
for number = 2, 14 do
str = create_ord_adv_sub(number)
numbers.adjectival = create_adjectival(number)
numbers.ordinal = ordinal_prefix .. str
numbers.distributive = get_adjectival(number) .. " " .. get_adjectival(number)
numbers.adverbial = adverbial_prefix .. adjectival_prefix .. str
numbers.collective = create_collective(number)
end
for number = 5, 14 do
numbers.fractional = fractional_prefix .. get_adjectival(number)
end
local twenties_endings = {
= "jì",
= "ta",
= "rin",
= "rùn-ún",
= "fà",
= "je",
= "jọ",
= "sàn-án",
= "wàá",
}
-- Creates base form for 20s
local function create_twenties(number)
str = numbers.counting
if mw.ustring.sub(str, 1, 1) == "e" then
return "ogó" .. twenties_endings
else
return "ọgọ́" .. twenties_endings
end
end
-- Creates base form for 10s in-between 20s
local function create_mid_twenties(number)
str = numbers.counting
if mw.ustring.sub(str, 1, 1) == "o" then
return "àádó" .. twenties_endings
else
return "àádọ́" .. twenties_endings
end
end
-- Add cardinals, counting, adjectival, and ordinal numbers for 15-200
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 = {
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 = {
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 = {
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.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 = {
cardinal = replace_card .. minus .. last_start .. mw.ustring.sub(mid_twenties, 2),
counting = replace_count .. minus .. last_start .. mw.ustring.sub(mid_twenties, 2),
}
numbers.adjectival = create_adjectival(twenties + ones)
str = create_ord_adv_sub(twenties + ones)
numbers.ordinal = ordinal_prefix .. str
end
for ones = -9, -6 do
base_num = 10 + ones
check = mw.ustring.sub(mid_twenties, 1, 1)
numbers = {
cardinal = replace_card .. plus .. last_start .. mw.ustring.sub(mid_twenties, 2),
counting = replace_count .. plus .. last_start .. mw.ustring.sub(mid_twenties, 2),
}
numbers.adjectival = create_adjectival(twenties + ones)
str = create_ord_adv_sub(twenties + ones)
numbers.ordinal = ordinal_prefix .. str
end
end
twenties_cardinal = numbers.cardinal
for ones = -5, -1 do
base_num = 0 - ones
check = mw.ustring.sub(twenties_cardinal, 1, 1)
numbers = {
cardinal = replace_card .. minus .. last_start .. mw.ustring.sub(twenties_cardinal, 2),
counting = replace_count .. minus .. last_start .. mw.ustring.sub(twenties_cardinal, 2)
}
numbers.adjectival = create_adjectival(twenties + ones)
str = create_ord_adv_sub(twenties + ones)
numbers.ordinal = ordinal_prefix .. str
end
if i ~= 10 then
for ones = 1, 4 do
base_num = ones
check = mw.ustring.sub(twenties_cardinal, 1, 1)
numbers = {
cardinal = replace_card .. plus .. last_start .. mw.ustring.sub(twenties_cardinal, 2),
counting = replace_count .. plus .. last_start .. mw.ustring.sub(twenties_cardinal, 2)
}
numbers.adjectival = create_adjectival(twenties + ones)
str = create_ord_adv_sub(twenties + ones)
numbers.ordinal = ordinal_prefix .. str
end
end
end
numbers = {
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 = {
cardinal = "irinwó",
counting = "irinwó",
adjectival = "irinwó",
ordinal = "irinwó",
adverbial = "ìgbà irinwó",
distributive = "irinwó irinwó",
}
numbers = {
cardinal = {"ẹgbàá","ẹgbẹ̀wàá"},
counting = {"ẹgbàá", "ẹgbẹ̀wàá"},
adjectival = {"ẹgbàá", "ẹgbẹ̀wàá"},
ordinal = {"ẹgbàá", "ẹgbẹ̀wàá"},
}
numbers = {
cardinal = "ọ̀kẹ́",
counting = "ọ̀kẹ́ kan",
}
-- Endings for the 200s
local two_hundreds_endings = {
= "ta",
= "rin",
= "rún",
= "fà",
= "je",
= "jọ",
= "sán",
= "wá",
= "ọ̀kànlá",
= "jìlá",
= "tàlá",
= "rìnlá",
= "ẹ́dógún",
= "rìndínlógún",
= "tàdínlógún",
= "jìdínlógún",
= "ọ̀kàndínlógún",
}
-- Creates base form for 200s
local function create_two_hundreds(number)
str = numbers.counting
if mw.ustring.sub(str, 1, 1) == "e" then
return "egbè" .. two_hundreds_endings
elseif mw.ustring.sub(str, 1, 1) == "o" then
return "ẹgb" .. two_hundreds_endings
else
return "ẹgbẹ̀" .. two_hundreds_endings
end
end
-- Creates base form for 100s in-between 200s
local function create_mid_two_hundreds(number)
str = numbers.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 = {
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 = {
cardinal = mid_two_hundreds,
counting = mid_two_hundreds,
adjectival = mid_two_hundreds,
ordinal = mid_two_hundreds,
}
else
mid_two_hundreds = "ẹ̀ẹ́dẹ́gbẹ̀wàá"
numbers = {
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
end
-- Creates base form for 1000s in-between 2000s
local function create_mid_two_thousands(number)
str = numbers.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 = {
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 = {
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.cardinal
y = numbers.counting
numbers = {
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 = {
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 = {
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 = {
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.cardinal
numbers = {
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 = {
cardinal = mid_two_hundreds,
counting = mid_two_hundreds,
adjectival = mid_two_hundreds,
ordinal = mid_two_hundreds,
}
end
end
numbers = {
cardinal = {numbers.cardinal, "ẹ̀ẹ́dógún"},
counting = {numbers.counting, "ẹ̀ẹ́dógún"},
adjectival = {numbers.adjectival, "mẹ́ẹ̀ẹ́dógún"},
ordinal = {numbers.ordinal, "kẹẹ́dógún"},
}
num_5000 = numbers.cardinal
numbers = {
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 = {
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 = {
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 = {
cardinal = {"bílíọ̀nù"},
counting = {"bílíọ̀n kan"},
adjectival = {"bílíọ̀n kan"},
ordinal = {"bílíọ̀n kan"},
}
numbers = {
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