#![allow(clippy::all)]
#![allow(unreachable_patterns)]
#![allow(unused_parens)]
#![allow(dead_code)]
use crate::plural::in_set;
use crate::plural::PluralCategory::{self, *};
use crate::plural::PluralOperands as Op;
pub(crate) fn plural_category(lang: &str, op: &Op) -> Option<PluralCategory> {
match lang {
"ff" | "hy" | "kab" => {
if (in_set((op.i as f64), &[(0.0, 0.0), (1.0, 1.0)])) {
return Some(One);
}
Some(Other)
}
"fr" => {
if (in_set((op.i as f64), &[(0.0, 0.0), (1.0, 1.0)])) {
return Some(One);
}
if (in_set((op.c as f64), &[(0.0, 0.0)])
&& !in_set((op.i as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 1000000.0), &[(0.0, 0.0)])
&& in_set((op.v as f64), &[(0.0, 0.0)]))
|| (!in_set((op.c as f64), &[(0.0, 5.0)]))
{
return Some(Many);
}
Some(Other)
}
"am" | "as" | "bn" | "doi" | "fa" | "gu" | "hi" | "kn" | "kok" | "kok-latn" | "pcm"
| "zu" => {
if (in_set((op.i as f64), &[(0.0, 0.0)])) || (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
Some(Other)
}
"shi" => {
if (in_set((op.i as f64), &[(0.0, 0.0)])) || (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 10.0)])) {
return Some(Few);
}
Some(Other)
}
"pt" => {
if (in_set((op.i as f64), &[(0.0, 1.0)])) {
return Some(One);
}
if (in_set((op.c as f64), &[(0.0, 0.0)])
&& !in_set((op.i as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 1000000.0), &[(0.0, 0.0)])
&& in_set((op.v as f64), &[(0.0, 0.0)]))
|| (!in_set((op.c as f64), &[(0.0, 5.0)]))
{
return Some(Many);
}
Some(Other)
}
"ast" | "de" | "en" | "et" | "fi" | "fy" | "gl" | "ia" | "ie" | "io" | "lij" | "nl"
| "sc" | "sv" | "sw" | "ur" | "yi" => {
if (in_set((op.i as f64), &[(1.0, 1.0)]) && in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(One);
}
Some(Other)
}
"mo" | "ro" => {
if (in_set((op.i as f64), &[(1.0, 1.0)]) && in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(One);
}
if (!in_set((op.v as f64), &[(0.0, 0.0)]))
|| (in_set(op.n, &[(0.0, 0.0)]))
|| (!in_set(op.n, &[(1.0, 1.0)]) && in_set((op.n % 100.0), &[(1.0, 19.0)]))
{
return Some(Few);
}
Some(Other)
}
"ca" | "it" | "lld" | "pt-pt" | "scn" | "vec" => {
if (in_set((op.i as f64), &[(1.0, 1.0)]) && in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(One);
}
if (in_set((op.c as f64), &[(0.0, 0.0)])
&& !in_set((op.i as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 1000000.0), &[(0.0, 0.0)])
&& in_set((op.v as f64), &[(0.0, 0.0)]))
|| (!in_set((op.c as f64), &[(0.0, 5.0)]))
{
return Some(Many);
}
Some(Other)
}
"cs" | "sk" => {
if (in_set((op.i as f64), &[(1.0, 1.0)]) && in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(One);
}
if (in_set((op.i as f64), &[(2.0, 4.0)]) && in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(Few);
}
if (!in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(Many);
}
Some(Other)
}
"pl" => {
if (in_set((op.i as f64), &[(1.0, 1.0)]) && in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(One);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(2.0, 4.0)])
&& !in_set(((op.i as f64) % 100.0), &[(12.0, 14.0)]))
{
return Some(Few);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& !in_set((op.i as f64), &[(1.0, 1.0)])
&& in_set(((op.i as f64) % 10.0), &[(0.0, 1.0)]))
|| (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(5.0, 9.0)]))
|| (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 100.0), &[(12.0, 14.0)]))
{
return Some(Many);
}
Some(Other)
}
"he" => {
if (in_set((op.i as f64), &[(1.0, 1.0)]) && in_set((op.v as f64), &[(0.0, 0.0)]))
|| (in_set((op.i as f64), &[(0.0, 0.0)]) && !in_set((op.v as f64), &[(0.0, 0.0)]))
{
return Some(One);
}
if (in_set((op.i as f64), &[(2.0, 2.0)]) && in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(Two);
}
Some(Other)
}
"lv" | "prg" => {
if (in_set((op.n % 10.0), &[(0.0, 0.0)]))
|| (in_set((op.n % 100.0), &[(11.0, 19.0)]))
|| (in_set((op.v as f64), &[(2.0, 2.0)])
&& in_set(((op.f as f64) % 100.0), &[(11.0, 19.0)]))
{
return Some(Zero);
}
if (in_set((op.n % 10.0), &[(1.0, 1.0)]) && !in_set((op.n % 100.0), &[(11.0, 11.0)]))
|| (in_set((op.v as f64), &[(2.0, 2.0)])
&& in_set(((op.f as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.f as f64) % 100.0), &[(11.0, 11.0)]))
|| (!in_set((op.v as f64), &[(2.0, 2.0)])
&& in_set(((op.f as f64) % 10.0), &[(1.0, 1.0)]))
{
return Some(One);
}
Some(Other)
}
"br" => {
if (in_set((op.n % 10.0), &[(1.0, 1.0)])
&& !in_set((op.n % 100.0), &[(11.0, 11.0), (71.0, 71.0), (91.0, 91.0)]))
{
return Some(One);
}
if (in_set((op.n % 10.0), &[(2.0, 2.0)])
&& !in_set((op.n % 100.0), &[(12.0, 12.0), (72.0, 72.0), (92.0, 92.0)]))
{
return Some(Two);
}
if (in_set((op.n % 10.0), &[(3.0, 4.0), (9.0, 9.0)])
&& !in_set((op.n % 100.0), &[(10.0, 19.0), (70.0, 79.0), (90.0, 99.0)]))
{
return Some(Few);
}
if (!in_set(op.n, &[(0.0, 0.0)]) && in_set((op.n % 1000000.0), &[(0.0, 0.0)])) {
return Some(Many);
}
Some(Other)
}
"be" => {
if (in_set((op.n % 10.0), &[(1.0, 1.0)]) && !in_set((op.n % 100.0), &[(11.0, 11.0)])) {
return Some(One);
}
if (in_set((op.n % 10.0), &[(2.0, 4.0)]) && !in_set((op.n % 100.0), &[(12.0, 14.0)])) {
return Some(Few);
}
if (in_set((op.n % 10.0), &[(0.0, 0.0)]))
|| (in_set((op.n % 10.0), &[(5.0, 9.0)]))
|| (in_set((op.n % 100.0), &[(11.0, 14.0)]))
{
return Some(Many);
}
Some(Other)
}
"sgs" => {
if (in_set((op.n % 10.0), &[(1.0, 1.0)]) && !in_set((op.n % 100.0), &[(11.0, 11.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0)])) {
return Some(Two);
}
if (!in_set(op.n, &[(2.0, 2.0)])
&& in_set((op.n % 10.0), &[(2.0, 9.0)])
&& !in_set((op.n % 100.0), &[(11.0, 19.0)]))
{
return Some(Few);
}
if (!in_set((op.f as f64), &[(0.0, 0.0)])) {
return Some(Many);
}
Some(Other)
}
"lt" => {
if (in_set((op.n % 10.0), &[(1.0, 1.0)]) && !in_set((op.n % 100.0), &[(11.0, 19.0)])) {
return Some(One);
}
if (in_set((op.n % 10.0), &[(2.0, 9.0)]) && !in_set((op.n % 100.0), &[(11.0, 19.0)])) {
return Some(Few);
}
if (!in_set((op.f as f64), &[(0.0, 0.0)])) {
return Some(Many);
}
Some(Other)
}
"is" => {
if (in_set((op.t as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.i as f64) % 100.0), &[(11.0, 11.0)]))
|| (in_set(((op.t as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.t as f64) % 100.0), &[(11.0, 11.0)]))
{
return Some(One);
}
Some(Other)
}
"ru" | "uk" => {
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.i as f64) % 100.0), &[(11.0, 11.0)]))
{
return Some(One);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(2.0, 4.0)])
&& !in_set(((op.i as f64) % 100.0), &[(12.0, 14.0)]))
{
return Some(Few);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(0.0, 0.0)]))
|| (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(5.0, 9.0)]))
|| (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 100.0), &[(11.0, 14.0)]))
{
return Some(Many);
}
Some(Other)
}
"mk" => {
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.i as f64) % 100.0), &[(11.0, 11.0)]))
|| (in_set(((op.f as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.f as f64) % 100.0), &[(11.0, 11.0)]))
{
return Some(One);
}
Some(Other)
}
"bs" | "hr" | "sh" | "sr" => {
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.i as f64) % 100.0), &[(11.0, 11.0)]))
|| (in_set(((op.f as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.f as f64) % 100.0), &[(11.0, 11.0)]))
{
return Some(One);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(2.0, 4.0)])
&& !in_set(((op.i as f64) % 100.0), &[(12.0, 14.0)]))
|| (in_set(((op.f as f64) % 10.0), &[(2.0, 4.0)])
&& !in_set(((op.f as f64) % 100.0), &[(12.0, 14.0)]))
{
return Some(Few);
}
Some(Other)
}
"gv" => {
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(1.0, 1.0)]))
{
return Some(One);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 10.0), &[(2.0, 2.0)]))
{
return Some(Two);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(
((op.i as f64) % 100.0),
&[
(0.0, 0.0),
(20.0, 20.0),
(40.0, 40.0),
(60.0, 60.0),
(80.0, 80.0),
],
))
{
return Some(Few);
}
if (!in_set((op.v as f64), &[(0.0, 0.0)])) {
return Some(Many);
}
Some(Other)
}
"sl" => {
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 100.0), &[(1.0, 1.0)]))
{
return Some(One);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 100.0), &[(2.0, 2.0)]))
{
return Some(Two);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 100.0), &[(3.0, 4.0)]))
|| (!in_set((op.v as f64), &[(0.0, 0.0)]))
{
return Some(Few);
}
Some(Other)
}
"dsb" | "hsb" => {
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 100.0), &[(1.0, 1.0)]))
|| (in_set(((op.f as f64) % 100.0), &[(1.0, 1.0)]))
{
return Some(One);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 100.0), &[(2.0, 2.0)]))
|| (in_set(((op.f as f64) % 100.0), &[(2.0, 2.0)]))
{
return Some(Two);
}
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 100.0), &[(3.0, 4.0)]))
|| (in_set(((op.f as f64) % 100.0), &[(3.0, 4.0)]))
{
return Some(Few);
}
Some(Other)
}
"ceb" | "fil" | "tl" => {
if (in_set((op.v as f64), &[(0.0, 0.0)])
&& in_set((op.i as f64), &[(1.0, 1.0), (2.0, 2.0), (3.0, 3.0)]))
|| (in_set((op.v as f64), &[(0.0, 0.0)])
&& !in_set(
((op.i as f64) % 10.0),
&[(4.0, 4.0), (6.0, 6.0), (9.0, 9.0)],
))
|| (!in_set((op.v as f64), &[(0.0, 0.0)])
&& !in_set(
((op.f as f64) % 10.0),
&[(4.0, 4.0), (6.0, 6.0), (9.0, 9.0)],
))
{
return Some(One);
}
Some(Other)
}
"si" => {
if (in_set(op.n, &[(0.0, 0.0), (1.0, 1.0)]))
|| (in_set((op.i as f64), &[(0.0, 0.0)]) && in_set((op.f as f64), &[(1.0, 1.0)]))
{
return Some(One);
}
Some(Other)
}
"lag" => {
if (in_set(op.n, &[(0.0, 0.0)])) {
return Some(Zero);
}
if (in_set((op.i as f64), &[(0.0, 0.0), (1.0, 1.0)]) && !in_set(op.n, &[(0.0, 0.0)])) {
return Some(One);
}
Some(Other)
}
"blo" | "cv" | "ksh" => {
if (in_set(op.n, &[(0.0, 0.0)])) {
return Some(Zero);
}
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
Some(Other)
}
"kw" => {
if (in_set(op.n, &[(0.0, 0.0)])) {
return Some(Zero);
}
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(
(op.n % 100.0),
&[
(2.0, 2.0),
(22.0, 22.0),
(42.0, 42.0),
(62.0, 62.0),
(82.0, 82.0),
],
)) || (in_set((op.n % 1000.0), &[(0.0, 0.0)])
&& in_set(
(op.n % 100000.0),
&[
(1000.0, 20000.0),
(40000.0, 40000.0),
(60000.0, 60000.0),
(80000.0, 80000.0),
],
))
|| (!in_set(op.n, &[(0.0, 0.0)])
&& in_set((op.n % 1000000.0), &[(100000.0, 100000.0)]))
{
return Some(Two);
}
if (in_set(
(op.n % 100.0),
&[
(3.0, 3.0),
(23.0, 23.0),
(43.0, 43.0),
(63.0, 63.0),
(83.0, 83.0),
],
)) {
return Some(Few);
}
if (!in_set(op.n, &[(1.0, 1.0)])
&& in_set(
(op.n % 100.0),
&[
(1.0, 1.0),
(21.0, 21.0),
(41.0, 41.0),
(61.0, 61.0),
(81.0, 81.0),
],
))
{
return Some(Many);
}
Some(Other)
}
"ar" | "ars" => {
if (in_set(op.n, &[(0.0, 0.0)])) {
return Some(Zero);
}
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0)])) {
return Some(Two);
}
if (in_set((op.n % 100.0), &[(3.0, 10.0)])) {
return Some(Few);
}
if (in_set((op.n % 100.0), &[(11.0, 99.0)])) {
return Some(Many);
}
Some(Other)
}
"cy" => {
if (in_set(op.n, &[(0.0, 0.0)])) {
return Some(Zero);
}
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(3.0, 3.0)])) {
return Some(Few);
}
if (in_set(op.n, &[(6.0, 6.0)])) {
return Some(Many);
}
Some(Other)
}
"ak" | "bho" | "csw" | "guw" | "ln" | "mg" | "nso" | "pa" | "ti" | "wa" => {
if (in_set(op.n, &[(0.0, 1.0)])) {
return Some(One);
}
Some(Other)
}
"tzm" => {
if (in_set(op.n, &[(0.0, 1.0)])) || (in_set(op.n, &[(11.0, 99.0)])) {
return Some(One);
}
Some(Other)
}
"gd" => {
if (in_set(op.n, &[(1.0, 1.0), (11.0, 11.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0), (12.0, 12.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(3.0, 10.0), (13.0, 19.0)])) {
return Some(Few);
}
Some(Other)
}
"af" | "an" | "asa" | "az" | "bal" | "bem" | "bez" | "bg" | "brx" | "ce" | "cgg"
| "chr" | "ckb" | "dv" | "ee" | "el" | "eo" | "eu" | "fo" | "fur" | "gsw" | "ha"
| "haw" | "hu" | "jgo" | "jmc" | "ka" | "kaj" | "kcg" | "kk" | "kkj" | "kl" | "ks"
| "ksb" | "ku" | "ky" | "lb" | "lg" | "mas" | "mgo" | "ml" | "mn" | "mr" | "nah" | "nb"
| "nd" | "ne" | "nn" | "nnh" | "no" | "nr" | "ny" | "nyn" | "om" | "or" | "os" | "pap"
| "ps" | "rm" | "rof" | "rwk" | "saq" | "sd" | "sdh" | "seh" | "sn" | "so" | "sq"
| "ss" | "ssy" | "st" | "syr" | "ta" | "te" | "teo" | "tig" | "tk" | "tn" | "tr" | "ts"
| "ug" | "uz" | "ve" | "vo" | "vun" | "wae" | "xh" | "xog" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
Some(Other)
}
"es" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set((op.c as f64), &[(0.0, 0.0)])
&& !in_set((op.i as f64), &[(0.0, 0.0)])
&& in_set(((op.i as f64) % 1000000.0), &[(0.0, 0.0)])
&& in_set((op.v as f64), &[(0.0, 0.0)]))
|| (!in_set((op.c as f64), &[(0.0, 5.0)]))
{
return Some(Many);
}
Some(Other)
}
"iu" | "naq" | "sat" | "se" | "sma" | "smi" | "smj" | "smn" | "sms" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0)])) {
return Some(Two);
}
Some(Other)
}
"mt" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(0.0, 0.0)])) || (in_set((op.n % 100.0), &[(3.0, 10.0)])) {
return Some(Few);
}
if (in_set((op.n % 100.0), &[(11.0, 19.0)])) {
return Some(Many);
}
Some(Other)
}
"ga" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(3.0, 6.0)])) {
return Some(Few);
}
if (in_set(op.n, &[(7.0, 10.0)])) {
return Some(Many);
}
Some(Other)
}
"da" => {
if (in_set(op.n, &[(1.0, 1.0)]))
|| (!in_set((op.t as f64), &[(0.0, 0.0)])
&& in_set((op.i as f64), &[(0.0, 0.0), (1.0, 1.0)]))
{
return Some(One);
}
Some(Other)
}
_ => None,
}
}
pub(crate) fn ordinal_category(lang: &str, op: &Op) -> Option<PluralCategory> {
match lang {
"az" => {
if (in_set(
((op.i as f64) % 10.0),
&[(1.0, 1.0), (2.0, 2.0), (5.0, 5.0), (7.0, 7.0), (8.0, 8.0)],
)) || (in_set(
((op.i as f64) % 100.0),
&[(20.0, 20.0), (50.0, 50.0), (70.0, 70.0), (80.0, 80.0)],
)) {
return Some(One);
}
if (in_set(((op.i as f64) % 10.0), &[(3.0, 3.0), (4.0, 4.0)]))
|| (in_set(
((op.i as f64) % 1000.0),
&[
(100.0, 100.0),
(200.0, 200.0),
(300.0, 300.0),
(400.0, 400.0),
(500.0, 500.0),
(600.0, 600.0),
(700.0, 700.0),
(800.0, 800.0),
(900.0, 900.0),
],
))
{
return Some(Few);
}
if (in_set((op.i as f64), &[(0.0, 0.0)]))
|| (in_set(((op.i as f64) % 10.0), &[(6.0, 6.0)]))
|| (in_set(
((op.i as f64) % 100.0),
&[(40.0, 40.0), (60.0, 60.0), (90.0, 90.0)],
))
{
return Some(Many);
}
Some(Other)
}
"mk" => {
if (in_set(((op.i as f64) % 10.0), &[(1.0, 1.0)])
&& !in_set(((op.i as f64) % 100.0), &[(11.0, 11.0)]))
{
return Some(One);
}
if (in_set(((op.i as f64) % 10.0), &[(2.0, 2.0)])
&& !in_set(((op.i as f64) % 100.0), &[(12.0, 12.0)]))
{
return Some(Two);
}
if (in_set(((op.i as f64) % 10.0), &[(7.0, 7.0), (8.0, 8.0)])
&& !in_set(((op.i as f64) % 100.0), &[(17.0, 17.0), (18.0, 18.0)]))
{
return Some(Many);
}
Some(Other)
}
"blo" => {
if (in_set((op.i as f64), &[(0.0, 0.0)])) {
return Some(Zero);
}
if (in_set((op.i as f64), &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(
(op.i as f64),
&[(2.0, 2.0), (3.0, 3.0), (4.0, 4.0), (5.0, 5.0), (6.0, 6.0)],
)) {
return Some(Few);
}
Some(Other)
}
"ka" => {
if (in_set((op.i as f64), &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set((op.i as f64), &[(0.0, 0.0)]))
|| (in_set(
((op.i as f64) % 100.0),
&[(2.0, 20.0), (40.0, 40.0), (60.0, 60.0), (80.0, 80.0)],
))
{
return Some(Many);
}
Some(Other)
}
"sv" => {
if (in_set((op.n % 10.0), &[(1.0, 1.0), (2.0, 2.0)])
&& !in_set((op.n % 100.0), &[(11.0, 11.0), (12.0, 12.0)]))
{
return Some(One);
}
Some(Other)
}
"en" => {
if (in_set((op.n % 10.0), &[(1.0, 1.0)]) && !in_set((op.n % 100.0), &[(11.0, 11.0)])) {
return Some(One);
}
if (in_set((op.n % 10.0), &[(2.0, 2.0)]) && !in_set((op.n % 100.0), &[(12.0, 12.0)])) {
return Some(Two);
}
if (in_set((op.n % 10.0), &[(3.0, 3.0)]) && !in_set((op.n % 100.0), &[(13.0, 13.0)])) {
return Some(Few);
}
Some(Other)
}
"be" => {
if (in_set((op.n % 10.0), &[(2.0, 2.0), (3.0, 3.0)])
&& !in_set((op.n % 100.0), &[(12.0, 12.0), (13.0, 13.0)]))
{
return Some(Few);
}
Some(Other)
}
"uk" => {
if (in_set((op.n % 10.0), &[(3.0, 3.0)]) && !in_set((op.n % 100.0), &[(13.0, 13.0)])) {
return Some(Few);
}
Some(Other)
}
"tk" => {
if (in_set((op.n % 10.0), &[(6.0, 6.0), (9.0, 9.0)])) || (in_set(op.n, &[(10.0, 10.0)]))
{
return Some(Few);
}
Some(Other)
}
"kk" => {
if (in_set((op.n % 10.0), &[(6.0, 6.0)]))
|| (in_set((op.n % 10.0), &[(9.0, 9.0)]))
|| (in_set((op.n % 10.0), &[(0.0, 0.0)]) && !in_set(op.n, &[(0.0, 0.0)]))
{
return Some(Many);
}
Some(Other)
}
"cy" => {
if (in_set(op.n, &[(0.0, 0.0), (7.0, 7.0), (8.0, 8.0), (9.0, 9.0)])) {
return Some(Zero);
}
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(3.0, 3.0), (4.0, 4.0)])) {
return Some(Few);
}
if (in_set(op.n, &[(5.0, 5.0), (6.0, 6.0)])) {
return Some(Many);
}
Some(Other)
}
"gd" => {
if (in_set(op.n, &[(1.0, 1.0), (11.0, 11.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0), (12.0, 12.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(3.0, 3.0), (13.0, 13.0)])) {
return Some(Few);
}
Some(Other)
}
"ca" => {
if (in_set(op.n, &[(1.0, 1.0), (3.0, 3.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(4.0, 4.0)])) {
return Some(Few);
}
Some(Other)
}
"as" | "bn" => {
if (in_set(
op.n,
&[
(1.0, 1.0),
(5.0, 5.0),
(7.0, 7.0),
(8.0, 8.0),
(9.0, 9.0),
(10.0, 10.0),
],
)) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0), (3.0, 3.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(4.0, 4.0)])) {
return Some(Few);
}
if (in_set(op.n, &[(6.0, 6.0)])) {
return Some(Many);
}
Some(Other)
}
"or" => {
if (in_set(op.n, &[(1.0, 1.0), (5.0, 5.0), (7.0, 9.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0), (3.0, 3.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(4.0, 4.0)])) {
return Some(Few);
}
if (in_set(op.n, &[(6.0, 6.0)])) {
return Some(Many);
}
Some(Other)
}
"hu" => {
if (in_set(op.n, &[(1.0, 1.0), (5.0, 5.0)])) {
return Some(One);
}
Some(Other)
}
"bal" | "fil" | "fr" | "ga" | "hy" | "lo" | "mo" | "ms" | "ro" | "tl" | "vi" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
Some(Other)
}
"sq" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set((op.n % 10.0), &[(4.0, 4.0)]) && !in_set((op.n % 100.0), &[(14.0, 14.0)])) {
return Some(Many);
}
Some(Other)
}
"kok" | "kok-latn" | "mr" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0), (3.0, 3.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(4.0, 4.0)])) {
return Some(Few);
}
Some(Other)
}
"gu" | "hi" => {
if (in_set(op.n, &[(1.0, 1.0)])) {
return Some(One);
}
if (in_set(op.n, &[(2.0, 2.0), (3.0, 3.0)])) {
return Some(Two);
}
if (in_set(op.n, &[(4.0, 4.0)])) {
return Some(Few);
}
if (in_set(op.n, &[(6.0, 6.0)])) {
return Some(Many);
}
Some(Other)
}
"ne" => {
if (in_set(op.n, &[(1.0, 4.0)])) {
return Some(One);
}
Some(Other)
}
"kw" => {
if (in_set(op.n, &[(1.0, 4.0)]))
|| (in_set(
(op.n % 100.0),
&[
(1.0, 4.0),
(21.0, 24.0),
(41.0, 44.0),
(61.0, 64.0),
(81.0, 84.0),
],
))
{
return Some(One);
}
if (in_set(op.n, &[(5.0, 5.0)])) || (in_set((op.n % 100.0), &[(5.0, 5.0)])) {
return Some(Many);
}
Some(Other)
}
"it" | "lld" | "sc" | "vec" => {
if (in_set(
op.n,
&[(11.0, 11.0), (8.0, 8.0), (80.0, 80.0), (800.0, 800.0)],
)) {
return Some(Many);
}
Some(Other)
}
"lij" | "scn" => {
if (in_set(
op.n,
&[(11.0, 11.0), (8.0, 8.0), (80.0, 89.0), (800.0, 899.0)],
)) {
return Some(Many);
}
Some(Other)
}
_ => None,
}
}