Module:number list/data/ca

local export = {numbers = {}}

local numbers = export.numbers

numbers[0] = { cardinal = "zero", wplink = "zero", }

numbers[1] = { cardinal = "un", ordinal = "primer", ordinal_abbr = "1r", wplink = "u (nombre)", }

numbers[2] = { cardinal = "dos", ordinal = "segon", ordinal_abbr = "2n", multiplier = "doble", fractional = "mig", wplink = "dos", }

numbers[3] = { cardinal = "tres", ordinal = "tercer", ordinal_abbr = "3r", multiplier = "triple", fractional = "terç", wplink = "tres", }

numbers[4] = { cardinal = "quatre", ordinal = "quart", ordinal_abbr = "4t", multiplier = "quàdruple", wplink = "quatre", }

numbers[5] = { cardinal = "cinc", ordinal = {"cinquè", "cinqué", "quint"}, ordinal_abbr = {"5è", "5é", "5t"}, multiplier = "quíntuple", wplink = "cinc", }

numbers[6] = { cardinal = "sis", ordinal = {"sisè", "sisé", "sext"}, ordinal_abbr = {"6è", "6é", "6t"}, multiplier = "sèxtuple", wplink = "sis", }

numbers[7] = { cardinal = "set", ordinal = {"setè", "seté", "sèptim"}, ordinal_abbr = {"7è", "7é<tag:Valencian>", "7m<tag:Latinate>"}, multiplier = "sèptuple", wplink = "nombre set", }

numbers[8] = { cardinal = {"vuit<tag:Central>", "huit<tag:Valencian>"}, ordinal = {"vuitè<tag:Central>", "huité<tag:Valencian>", "octau<tag:Latinate>"}, ordinal_abbr = {"8è<tag:Central>", "8é<tag:Valencian>", "8u<tag:Latinate>"}, multiplier = "òctuple", wplink = "vuit", }

numbers[9] = { cardinal = "nou", ordinal = {"novè<tag:Central>", "nové<tag:Valencian>"}, ordinal_abbr = {"9è<tag:Central>", "9é<tag:Valencian>"}, multiplier = "nònuple", wplink = "nombre nou", }

numbers[10] = { cardinal = "deu", ordinal = {"desè<tag:Central>", "desé<tag:Valencian>", "dècim<tag:Latinate>"}, ordinal_abbr = {"10è<tag:Central>", "10é<tag:Valencian>", "10m<tag:Latinate>"}, multiplier = "dècuple", wplink = "deu", }

local function split_and_localize_num(num) local valnum = num:gsub("vuit", "huit"):gsub("è$", "é") if valnum == num then return num else return {num .. "<tag:Central>", valnum .. "<tag:Valencian>"} end end

local function add_ordinal_suffix(cardinal) local num = cardinal:gsub(".$", { a = "", e = "", c = "qu", u = "v" }) .. "è" return split_and_localize_num(num) end

for i, cardinal in ipairs { "onze", "dotze", "tretze", "catorze", "quinze", "setze", } do	local number = 10 + i	numbers[number] = { cardinal = cardinal, ordinal = add_ordinal_suffix(cardinal), wplink = cardinal, } end

numbers[17] = { cardinal = {"disset<tag:Central>", "dèsset<tag:Valencian>", "desset<tag:Valencian>"}, ordinal = {"dissetè<tag:Central>", "desseté<tag:Valencian>"}, wplink = "disset", }

numbers[18] = { cardinal = {"divuit<tag:Central>", "díhuit<tag:Valencian>"}, ordinal = {"divuitè<tag:Central>", "dihuité<tag:Valencian>"}, wplink = "divuit", }

numbers[19] = { cardinal = {"dinou<tag:Central>", "dènou<tag:Valencian>", "dèneu<tag:Valencian>"}, ordinal = {"dinovè<tag:Central>", "denové<tag:Valencian>"}, wplink = "dinou", }

local function make_number_entry(cardinal) return { cardinal = split_and_localize_num(cardinal), ordinal = add_ordinal_suffix(cardinal), wplink = cardinal, } end

for i, tens_cardinal in ipairs { "vint", "trenta", "quaranta", "cinquanta", "seixanta", "setanta", "vuitanta", "noranta", } do	local tens = (i + 1) * 10 numbers[tens] = make_number_entry(tens_cardinal) for ones = 1, 9 do		local ones_numeral = numbers[ones] -- 8 is already split into vuit (Central) and huit (Valencian). local ones_cardinal = ones == 8 and "vuit" or ones_numeral.cardinal local intervening if tens == 20 then intervening = "-i-" else intervening = "-" end numbers[tens + ones] = make_number_entry(tens_cardinal .. intervening .. ones_cardinal) end end

numbers[100] = { cardinal = "cent", ordinal = {"centè<tag:Central>", "centèsim", "centé<tag:Valencian>"}, multiplier = "cèntuple", wplink = "cent", }

numbers[144] = { cardinal = "cent quaranta-quatre", ordinal = add_ordinal_suffix("cent quaranta-quatre"), }

for hundreds = 2, 9 do	local number = hundreds * 100 -- 8 is already split into vuit (Central) and huit (Valencian). local hundreds_cardinal = hundreds == 8 and "vuit" or numbers[hundreds].cardinal local base_cardinal = hundreds_cardinal .. "-cent" local cardinal = base_cardinal .. "s" numbers[number] = { cardinal = split_and_localize_num(cardinal), ordinal = add_ordinal_suffix(base_cardinal), wplink = cardinal, } end

numbers[1000] = { cardinal = "mil", ordinal = {"milè<tag:Central>", "mil·lèsim", "milé<tag:Valencian>"}, wplink = "mil", }

numbers[1000000] = { cardinal = "un milió<link:milió>", ordinal = "milionèsim", wplink = "milió", }

local function power_of(n) return "1" .. string.rep("0", n) end

numbers[power_of(12)] = { cardinal = "un bilió<link:bilió>", ordinal = "bilionèsim", wplink = "bilió", }

numbers[power_of(18)] = { cardinal = "un trilió<link:trilió>", ordinal = "trilionèsim", wplink = "trilió", }

numbers[power_of(24)] = { cardinal = "un quadrilió<link:quadrilió>", ordinal = "quadrilionèsim", wplink = "quadrilió", }

numbers[power_of(30)] = { cardinal = "un quintilió<link:quintilió>", ordinal = "quintilionèsim", wplink = "quintilió", }

numbers[1].cardinal = {"u", "un"}

return export