#![allow(unused_variables, unused_parens)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp))]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::nonminimal_bool))]
use super::operands::PluralOperands;
use super::{PluralCategory, PluralRuleType};
use matches::matches;
use phf;
pub type PluralRule = fn(&PluralOperands) -> PluralCategory;
pub static CLDR_VERSION: usize = 35;
pub fn get_locales(pr_type: PluralRuleType) -> &'static [&'static str] {
match pr_type {
PluralRuleType::CARDINAL => &[
"af", "ak", "am", "ar", "ars", "as", "asa", "ast", "az", "be", "bem", "bez", "bg",
"bh", "bm", "bn", "bo", "br", "brx", "bs", "ca", "ce", "ceb", "cgg", "chr", "ckb",
"cs", "cy", "da", "de", "dsb", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu",
"fa", "ff", "fi", "fil", "fo", "fr", "fur", "fy", "ga", "gd", "gl", "gsw", "gu", "guw",
"gv", "ha", "haw", "he", "hi", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "in",
"io", "is", "it", "iu", "iw", "ja", "jbo", "jgo", "ji", "jmc", "jv", "jw", "ka", "kab",
"kaj", "kcg", "kde", "kea", "kk", "kkj", "kl", "km", "kn", "ko", "ks", "ksb", "ksh",
"ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln", "lo", "lt", "lv", "mas", "mg", "mgo",
"mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "nah", "naq", "nb", "nd", "ne", "nl",
"nn", "nnh", "no", "nqo", "nr", "nso", "ny", "nyn", "om", "or", "os", "pa", "pap",
"pl", "prg", "ps", "pt", "pt-PT", "rm", "ro", "rof", "root", "ru", "rwk", "sah", "saq",
"sc", "scn", "sd", "sdh", "se", "seh", "ses", "sg", "sh", "shi", "si", "sk", "sl",
"sma", "smi", "smj", "smn", "sms", "sn", "so", "sq", "sr", "ss", "ssy", "st", "sv",
"sw", "syr", "ta", "te", "teo", "th", "ti", "tig", "tk", "tl", "tn", "to", "tr", "ts",
"tzm", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "vun", "wa", "wae", "wo", "xh", "xog",
"yi", "yo", "yue", "zh", "zu",
],
PluralRuleType::ORDINAL => &[
"af", "am", "ar", "as", "az", "be", "bg", "bn", "bs", "ca", "ce", "cs", "cy", "da",
"de", "dsb", "el", "en", "es", "et", "eu", "fa", "fi", "fil", "fr", "fy", "ga", "gd",
"gl", "gsw", "gu", "he", "hi", "hr", "hsb", "hu", "hy", "ia", "id", "in", "is", "it",
"iw", "ja", "ka", "kk", "km", "kn", "ko", "kw", "ky", "lo", "lt", "lv", "mk", "ml",
"mn", "mo", "mr", "ms", "my", "nb", "ne", "nl", "or", "pa", "pl", "prg", "ps", "pt",
"ro", "root", "ru", "sc", "scn", "sd", "sh", "si", "sk", "sl", "sq", "sr", "sv", "sw",
"ta", "te", "th", "tk", "tl", "tr", "uk", "ur", "uz", "vi", "yue", "zh", "zu",
],
}
}
#[cfg_attr(tarpaulin, skip)]
pub fn get_pr(lang_code: &str, pr_type: PluralRuleType) -> Result<PluralRule, ()> {
match pr_type {
PluralRuleType::CARDINAL => {
static LANGUAGES: phf::Map<&'static str, PluralRule> = ::phf::Map {
key: 732231254413039614,
disps: ::phf::Slice::Static(&[
(5, 34),
(0, 0),
(0, 14),
(7, 9),
(5, 62),
(0, 4),
(0, 164),
(0, 12),
(0, 0),
(0, 4),
(0, 45),
(0, 23),
(0, 0),
(0, 104),
(0, 4),
(1, 110),
(8, 48),
(0, 48),
(1, 155),
(0, 0),
(0, 9),
(1, 85),
(0, 26),
(0, 44),
(3, 150),
(4, 102),
(27, 84),
(4, 203),
(10, 176),
(2, 66),
(0, 182),
(8, 166),
(0, 5),
(0, 7),
(1, 122),
(24, 78),
(33, 130),
(0, 0),
(0, 67),
(24, 174),
(0, 86),
(5, 60),
]),
entries: ::phf::Slice::Static(&[
("tr", {
fn rule_tr(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_tr
}),
("sn", {
fn rule_sn(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sn
}),
("ne", {
fn rule_ne(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ne
}),
("ml", {
fn rule_ml(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ml
}),
("ur", {
fn rule_ur(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ur
}),
("chr", {
fn rule_chr(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_chr
}),
("af", {
fn rule_af(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_af
}),
("sg", {
fn rule_sg(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_sg
}),
("iu", {
fn rule_iu(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_iu
}),
("bem", {
fn rule_bem(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_bem
}),
("jw", {
fn rule_jw(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_jw
}),
("ee", {
fn rule_ee(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ee
}),
("ny", {
fn rule_ny(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ny
}),
("ce", {
fn rule_ce(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ce
}),
("is", {
fn rule_is(po: &PluralOperands) -> PluralCategory {
if (po.t == 0 && po.i % 10 == 1 && po.i % 100 != 11) || (po.t != 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_is
}),
("om", {
fn rule_om(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_om
}),
("os", {
fn rule_os(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_os
}),
("dsb", {
fn rule_dsb(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && matches!(po.i % 100, 3..=4))
|| (matches!(po.f % 100, 3..=4))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i % 100 == 1) || (po.f % 100 == 1) {
PluralCategory::ONE
} else if (po.v == 0 && po.i % 100 == 2) || (po.f % 100 == 2) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_dsb
}),
("kea", {
fn rule_kea(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_kea
}),
("ug", {
fn rule_ug(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ug
}),
("syr", {
fn rule_syr(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_syr
}),
("kl", {
fn rule_kl(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_kl
}),
("lag", {
fn rule_lag(po: &PluralOperands) -> PluralCategory {
if ((po.i == 0 || po.i == 1) && po.n != 0.0) {
PluralCategory::ONE
} else if (po.n == 0.0) {
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_lag
}),
("jbo", {
fn rule_jbo(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_jbo
}),
("mk", {
fn rule_mk(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && po.i % 10 == 1 && po.i % 100 != 11)
|| (po.f % 10 == 1 && po.f % 100 != 11)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mk
}),
("kab", {
fn rule_kab(po: &PluralOperands) -> PluralCategory {
if (po.i == 0 || po.i == 1) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_kab
}),
("ksb", {
fn rule_ksb(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ksb
}),
("fo", {
fn rule_fo(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fo
}),
("zh", {
fn rule_zh(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_zh
}),
("da", {
fn rule_da(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) || (po.t != 0 && (po.i == 0 || po.i == 1)) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_da
}),
("lt", {
fn rule_lt(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 2..=9) && !matches!(po.i, 11..=19)) {
PluralCategory::FEW
} else if (po.f != 0) {
PluralCategory::MANY
} else if (po.i % 10 == 1 && !matches!(po.i, 11..=19)) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_lt
}),
("et", {
fn rule_et(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_et
}),
("gsw", {
fn rule_gsw(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_gsw
}),
("ia", {
fn rule_ia(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ia
}),
("sd", {
fn rule_sd(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sd
}),
("ve", {
fn rule_ve(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ve
}),
("dv", {
fn rule_dv(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_dv
}),
("ksh", {
fn rule_ksh(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 0.0) {
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_ksh
}),
("ks", {
fn rule_ks(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ks
}),
("tzm", {
fn rule_tzm(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0)
|| (matches!(po.i, 11..=99) && po.f == 0)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_tzm
}),
("de", {
fn rule_de(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_de
}),
("ji", {
fn rule_ji(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ji
}),
("in", {
fn rule_in(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_in
}),
("as", {
fn rule_as(po: &PluralOperands) -> PluralCategory {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_as
}),
("ms", {
fn rule_ms(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ms
}),
("si", {
fn rule_si(po: &PluralOperands) -> PluralCategory {
if (po.n == 0.0 || po.n == 1.0) || (po.i == 0 && po.f == 1) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_si
}),
("lg", {
fn rule_lg(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_lg
}),
("kkj", {
fn rule_kkj(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_kkj
}),
("pt-PT", {
fn rule_pt_pt(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_pt_pt
}),
("ga", {
fn rule_ga(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 3..=6) && po.f == 0) {
PluralCategory::FEW
} else if (matches!(po.i, 7..=10) && po.f == 0) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_ga
}),
("ars", {
fn rule_ars(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 3..=10)) {
PluralCategory::FEW
} else if (matches!(po.i, 11..=99)) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else if (po.n == 0.0) {
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_ars
}),
("en", {
fn rule_en(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_en
}),
("id", {
fn rule_id(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_id
}),
("rof", {
fn rule_rof(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_rof
}),
("hsb", {
fn rule_hsb(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && matches!(po.i % 100, 3..=4))
|| (matches!(po.f % 100, 3..=4))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i % 100 == 1) || (po.f % 100 == 1) {
PluralCategory::ONE
} else if (po.v == 0 && po.i % 100 == 2) || (po.f % 100 == 2) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_hsb
}),
("ar", {
fn rule_ar(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 3..=10)) {
PluralCategory::FEW
} else if (matches!(po.i, 11..=99)) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else if (po.n == 0.0) {
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_ar
}),
("seh", {
fn rule_seh(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_seh
}),
("lb", {
fn rule_lb(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_lb
}),
("ast", {
fn rule_ast(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ast
}),
("jgo", {
fn rule_jgo(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_jgo
}),
("yi", {
fn rule_yi(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_yi
}),
("tl", {
fn rule_tl(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && (po.i == 1 || po.i == 2 || po.i == 3))
|| (po.v == 0 && po.i % 10 != 4 && po.i % 10 != 6 && po.i % 10 != 9)
|| (po.v != 0 && po.f % 10 != 4 && po.f % 10 != 6 && po.f % 10 != 9)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_tl
}),
("nqo", {
fn rule_nqo(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_nqo
}),
("bg", {
fn rule_bg(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_bg
}),
("lkt", {
fn rule_lkt(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_lkt
}),
("nso", {
fn rule_nso(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nso
}),
("zu", {
fn rule_zu(po: &PluralOperands) -> PluralCategory {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_zu
}),
("rwk", {
fn rule_rwk(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_rwk
}),
("hu", {
fn rule_hu(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_hu
}),
("fur", {
fn rule_fur(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fur
}),
("kaj", {
fn rule_kaj(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_kaj
}),
("xh", {
fn rule_xh(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_xh
}),
("ko", {
fn rule_ko(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ko
}),
("bn", {
fn rule_bn(po: &PluralOperands) -> PluralCategory {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_bn
}),
("teo", {
fn rule_teo(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_teo
}),
("vo", {
fn rule_vo(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_vo
}),
("yo", {
fn rule_yo(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_yo
}),
("kcg", {
fn rule_kcg(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_kcg
}),
("fr", {
fn rule_fr(po: &PluralOperands) -> PluralCategory {
if (po.i == 0 || po.i == 1) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fr
}),
("wa", {
fn rule_wa(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_wa
}),
("gd", {
fn rule_gd(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 3..=10) && po.f == 0
|| matches!(po.i, 13..=19) && po.f == 0)
{
PluralCategory::FEW
} else if (po.n == 1.0 || po.n == 11.0) {
PluralCategory::ONE
} else if (po.n == 2.0 || po.n == 12.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_gd
}),
("jv", {
fn rule_jv(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_jv
}),
("io", {
fn rule_io(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_io
}),
("nd", {
fn rule_nd(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nd
}),
("ro", {
fn rule_ro(po: &PluralOperands) -> PluralCategory {
if (po.v != 0) || (po.n == 0.0) || (matches!(po.i, 2..=19)) {
PluralCategory::FEW
} else if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ro
}),
("wae", {
fn rule_wae(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_wae
}),
("hy", {
fn rule_hy(po: &PluralOperands) -> PluralCategory {
if (po.i == 0 || po.i == 1) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_hy
}),
("sr", {
fn rule_sr(po: &PluralOperands) -> PluralCategory {
if (po.v == 0
&& matches!(po.i % 10, 2..=4)
&& !matches!(po.i % 100, 12..=14))
|| (matches!(po.f % 10, 2..=4) && !matches!(po.f % 100, 12..=14))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i % 10 == 1 && po.i % 100 != 11)
|| (po.f % 10 == 1 && po.f % 100 != 11)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sr
}),
("tn", {
fn rule_tn(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_tn
}),
("haw", {
fn rule_haw(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_haw
}),
("mo", {
fn rule_mo(po: &PluralOperands) -> PluralCategory {
if (po.v != 0) || (po.n == 0.0) || (matches!(po.i, 2..=19)) {
PluralCategory::FEW
} else if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mo
}),
("es", {
fn rule_es(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_es
}),
("mn", {
fn rule_mn(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mn
}),
("fi", {
fn rule_fi(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fi
}),
("yue", {
fn rule_yue(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_yue
}),
("mg", {
fn rule_mg(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mg
}),
("xog", {
fn rule_xog(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_xog
}),
("ru", {
fn rule_ru(po: &PluralOperands) -> PluralCategory {
if (po.v == 0
&& matches!(po.i % 10, 2..=4)
&& !matches!(po.i % 100, 12..=14))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i % 10 == 0)
|| (po.v == 0 && matches!(po.i % 10, 5..=9))
|| (po.v == 0 && matches!(po.i % 100, 11..=14))
{
PluralCategory::MANY
} else if (po.v == 0 && po.i % 10 == 1 && po.i % 100 != 11) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ru
}),
("pa", {
fn rule_pa(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_pa
}),
("to", {
fn rule_to(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_to
}),
("prg", {
fn rule_prg(po: &PluralOperands) -> PluralCategory {
if (po.i % 10 == 1 && po.i % 100 != 11)
|| (po.v == 2 && po.f % 10 == 1 && po.f % 100 != 11)
|| (po.v != 2 && po.f % 10 == 1)
{
PluralCategory::ONE
} else if (po.i % 10 == 0)
|| (matches!(po.i, 11..=19))
|| (po.v == 2 && matches!(po.f % 100, 11..=19))
{
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_prg
}),
("sdh", {
fn rule_sdh(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sdh
}),
("nn", {
fn rule_nn(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nn
}),
("bs", {
fn rule_bs(po: &PluralOperands) -> PluralCategory {
if (po.v == 0
&& matches!(po.i % 10, 2..=4)
&& !matches!(po.i % 100, 12..=14))
|| (matches!(po.f % 10, 2..=4) && !matches!(po.f % 100, 12..=14))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i % 10 == 1 && po.i % 100 != 11)
|| (po.f % 10 == 1 && po.f % 100 != 11)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_bs
}),
("sh", {
fn rule_sh(po: &PluralOperands) -> PluralCategory {
if (po.v == 0
&& matches!(po.i % 10, 2..=4)
&& !matches!(po.i % 100, 12..=14))
|| (matches!(po.f % 10, 2..=4) && !matches!(po.f % 100, 12..=14))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i % 10 == 1 && po.i % 100 != 11)
|| (po.f % 10 == 1 && po.f % 100 != 11)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sh
}),
("iw", {
fn rule_iw(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && !matches!(po.i, 0..=10) && po.f == 0 && po.i % 10 == 0)
{
PluralCategory::MANY
} else if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else if (po.i == 2 && po.v == 0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_iw
}),
("sah", {
fn rule_sah(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_sah
}),
("sc", {
fn rule_sc(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sc
}),
("nr", {
fn rule_nr(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nr
}),
("sk", {
fn rule_sk(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 2..=4) && po.v == 0) {
PluralCategory::FEW
} else if (po.v != 0) {
PluralCategory::MANY
} else if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sk
}),
("guw", {
fn rule_guw(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_guw
}),
("th", {
fn rule_th(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_th
}),
("sq", {
fn rule_sq(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sq
}),
("ja", {
fn rule_ja(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ja
}),
("ln", {
fn rule_ln(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ln
}),
("it", {
fn rule_it(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_it
}),
("ts", {
fn rule_ts(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ts
}),
("ca", {
fn rule_ca(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ca
}),
("root", {
fn rule_root(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_root
}),
("kde", {
fn rule_kde(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_kde
}),
("gv", {
fn rule_gv(po: &PluralOperands) -> PluralCategory {
if (po.v == 0
&& (po.i % 100 == 0
|| po.i % 100 == 20
|| po.i % 100 == 40
|| po.i % 100 == 60
|| po.i % 100 == 80))
{
PluralCategory::FEW
} else if (po.v != 0) {
PluralCategory::MANY
} else if (po.v == 0 && po.i % 10 == 1) {
PluralCategory::ONE
} else if (po.v == 0 && po.i % 10 == 2) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_gv
}),
("fil", {
fn rule_fil(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && (po.i == 1 || po.i == 2 || po.i == 3))
|| (po.v == 0 && po.i % 10 != 4 && po.i % 10 != 6 && po.i % 10 != 9)
|| (po.v != 0 && po.f % 10 != 4 && po.f % 10 != 6 && po.f % 10 != 9)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fil
}),
("nl", {
fn rule_nl(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nl
}),
("cs", {
fn rule_cs(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 2..=4) && po.v == 0) {
PluralCategory::FEW
} else if (po.v != 0) {
PluralCategory::MANY
} else if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_cs
}),
("pt", {
fn rule_pt(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1)) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_pt
}),
("ka", {
fn rule_ka(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ka
}),
("scn", {
fn rule_scn(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_scn
}),
("bez", {
fn rule_bez(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_bez
}),
("vi", {
fn rule_vi(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_vi
}),
("uz", {
fn rule_uz(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_uz
}),
("ta", {
fn rule_ta(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ta
}),
("el", {
fn rule_el(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_el
}),
("sv", {
fn rule_sv(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sv
}),
("kn", {
fn rule_kn(po: &PluralOperands) -> PluralCategory {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_kn
}),
("az", {
fn rule_az(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_az
}),
("ff", {
fn rule_ff(po: &PluralOperands) -> PluralCategory {
if (po.i == 0 || po.i == 1) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ff
}),
("se", {
fn rule_se(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_se
}),
("mas", {
fn rule_mas(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mas
}),
("pl", {
fn rule_pl(po: &PluralOperands) -> PluralCategory {
if (po.v == 0
&& matches!(po.i % 10, 2..=4)
&& !matches!(po.i % 100, 12..=14))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i != 1 && matches!(po.i % 10, 0..=1))
|| (po.v == 0 && matches!(po.i % 10, 5..=9))
|| (po.v == 0 && matches!(po.i % 100, 12..=14))
{
PluralCategory::MANY
} else if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_pl
}),
("ses", {
fn rule_ses(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ses
}),
("mr", {
fn rule_mr(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mr
}),
("ss", {
fn rule_ss(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ss
}),
("eu", {
fn rule_eu(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_eu
}),
("sl", {
fn rule_sl(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && matches!(po.i % 100, 3..=4)) || (po.v != 0) {
PluralCategory::FEW
} else if (po.v == 0 && po.i % 100 == 1) {
PluralCategory::ONE
} else if (po.v == 0 && po.i % 100 == 2) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_sl
}),
("cgg", {
fn rule_cgg(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_cgg
}),
("bh", {
fn rule_bh(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_bh
}),
("dz", {
fn rule_dz(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_dz
}),
("ti", {
fn rule_ti(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ti
}),
("ig", {
fn rule_ig(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ig
}),
("ky", {
fn rule_ky(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ky
}),
("smi", {
fn rule_smi(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_smi
}),
("ckb", {
fn rule_ckb(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ckb
}),
("bm", {
fn rule_bm(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_bm
}),
("brx", {
fn rule_brx(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_brx
}),
("tk", {
fn rule_tk(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_tk
}),
("ceb", {
fn rule_ceb(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && (po.i == 1 || po.i == 2 || po.i == 3))
|| (po.v == 0 && po.i % 10 != 4 && po.i % 10 != 6 && po.i % 10 != 9)
|| (po.v != 0 && po.f % 10 != 4 && po.f % 10 != 6 && po.f % 10 != 9)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ceb
}),
("st", {
fn rule_st(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_st
}),
("so", {
fn rule_so(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_so
}),
("nah", {
fn rule_nah(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nah
}),
("rm", {
fn rule_rm(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_rm
}),
("cy", {
fn rule_cy(po: &PluralOperands) -> PluralCategory {
if (po.n == 3.0) {
PluralCategory::FEW
} else if (po.n == 6.0) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else if (po.n == 0.0) {
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_cy
}),
("lo", {
fn rule_lo(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_lo
}),
("smn", {
fn rule_smn(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_smn
}),
("lv", {
fn rule_lv(po: &PluralOperands) -> PluralCategory {
if (po.i % 10 == 1 && po.i % 100 != 11)
|| (po.v == 2 && po.f % 10 == 1 && po.f % 100 != 11)
|| (po.v != 2 && po.f % 10 == 1)
{
PluralCategory::ONE
} else if (po.i % 10 == 0)
|| (matches!(po.i, 11..=19))
|| (po.v == 2 && matches!(po.f % 100, 11..=19))
{
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_lv
}),
("shi", {
fn rule_shi(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 2..=10) && po.f == 0) {
PluralCategory::FEW
} else if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_shi
}),
("br", {
fn rule_br(po: &PluralOperands) -> PluralCategory {
if ((po.i % 10 == 9 || matches!(po.i, 3..=4))
&& !matches!(po.i, 10..=19)
&& !matches!(po.i, 70..=79)
&& !matches!(po.i, 90..=99))
{
PluralCategory::FEW
} else if (po.n != 0.0 && po.i % 1000000 == 0) {
PluralCategory::MANY
} else if (po.i % 10 == 1
&& po.i % 100 != 11
&& po.i % 100 != 71
&& po.i % 100 != 91)
{
PluralCategory::ONE
} else if (po.i % 10 == 2
&& po.i % 100 != 12
&& po.i % 100 != 72
&& po.i % 100 != 92)
{
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_br
}),
("km", {
fn rule_km(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_km
}),
("hi", {
fn rule_hi(po: &PluralOperands) -> PluralCategory {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_hi
}),
("fa", {
fn rule_fa(po: &PluralOperands) -> PluralCategory {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fa
}),
("ssy", {
fn rule_ssy(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ssy
}),
("or", {
fn rule_or(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_or
}),
("ha", {
fn rule_ha(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ha
}),
("am", {
fn rule_am(po: &PluralOperands) -> PluralCategory {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_am
}),
("eo", {
fn rule_eo(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_eo
}),
("vun", {
fn rule_vun(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_vun
}),
("smj", {
fn rule_smj(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_smj
}),
("ak", {
fn rule_ak(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 0..=1) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ak
}),
("bo", {
fn rule_bo(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_bo
}),
("mgo", {
fn rule_mgo(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mgo
}),
("sma", {
fn rule_sma(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_sma
}),
("pap", {
fn rule_pap(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_pap
}),
("wo", {
fn rule_wo(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_wo
}),
("sms", {
fn rule_sms(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_sms
}),
("fy", {
fn rule_fy(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fy
}),
("tig", {
fn rule_tig(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_tig
}),
("my", {
fn rule_my(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_my
}),
("he", {
fn rule_he(po: &PluralOperands) -> PluralCategory {
if (po.v == 0 && !matches!(po.i, 0..=10) && po.f == 0 && po.i % 10 == 0)
{
PluralCategory::MANY
} else if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else if (po.i == 2 && po.v == 0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_he
}),
("hr", {
fn rule_hr(po: &PluralOperands) -> PluralCategory {
if (po.v == 0
&& matches!(po.i % 10, 2..=4)
&& !matches!(po.i % 100, 12..=14))
|| (matches!(po.f % 10, 2..=4) && !matches!(po.f % 100, 12..=14))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i % 10 == 1 && po.i % 100 != 11)
|| (po.f % 10 == 1 && po.f % 100 != 11)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_hr
}),
("naq", {
fn rule_naq(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_naq
}),
("gl", {
fn rule_gl(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_gl
}),
("nnh", {
fn rule_nnh(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nnh
}),
("no", {
fn rule_no(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_no
}),
("ps", {
fn rule_ps(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ps
}),
("mt", {
fn rule_mt(po: &PluralOperands) -> PluralCategory {
if (po.n == 0.0) || (matches!(po.i, 2..=10)) {
PluralCategory::FEW
} else if (matches!(po.i, 11..=19)) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mt
}),
("ku", {
fn rule_ku(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ku
}),
("be", {
fn rule_be(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 2..=4) && !matches!(po.i, 12..=14)) {
PluralCategory::FEW
} else if (po.i % 10 == 0)
|| (matches!(po.i, 5..=9))
|| (matches!(po.i, 11..=14))
{
PluralCategory::MANY
} else if (po.i % 10 == 1 && po.i % 100 != 11) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_be
}),
("ii", {
fn rule_ii(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ii
}),
("sw", {
fn rule_sw(po: &PluralOperands) -> PluralCategory {
if (po.i == 1 && po.v == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sw
}),
("jmc", {
fn rule_jmc(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_jmc
}),
("kk", {
fn rule_kk(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_kk
}),
("kw", {
fn rule_kw(po: &PluralOperands) -> PluralCategory {
if (po.i % 100 == 3
|| po.i % 100 == 23
|| po.i % 100 == 43
|| po.i % 100 == 63
|| po.i % 100 == 83)
{
PluralCategory::FEW
} else if (po.n != 1.0
&& (po.i % 100 == 1
|| po.i % 100 == 21
|| po.i % 100 == 41
|| po.i % 100 == 61
|| po.i % 100 == 81))
{
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.i % 100 == 2
|| po.i % 100 == 22
|| po.i % 100 == 42
|| po.i % 100 == 62
|| po.i % 100 == 82)
|| (po.i % 1000 == 0
&& (po.i % 100000 == 40000
|| po.i % 100000 == 60000
|| po.i % 100000 == 80000
|| matches!(po.i, 1000..=20000)))
|| (po.n != 0.0 && po.i % 1000000 == 100000)
{
PluralCategory::TWO
} else if (po.n == 0.0) {
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_kw
}),
("nyn", {
fn rule_nyn(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nyn
}),
("te", {
fn rule_te(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_te
}),
("nb", {
fn rule_nb(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_nb
}),
("gu", {
fn rule_gu(po: &PluralOperands) -> PluralCategory {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_gu
}),
("asa", {
fn rule_asa(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_asa
}),
("saq", {
fn rule_saq(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_saq
}),
("uk", {
fn rule_uk(po: &PluralOperands) -> PluralCategory {
if (po.v == 0
&& matches!(po.i % 10, 2..=4)
&& !matches!(po.i % 100, 12..=14))
{
PluralCategory::FEW
} else if (po.v == 0 && po.i % 10 == 0)
|| (po.v == 0 && matches!(po.i % 10, 5..=9))
|| (po.v == 0 && matches!(po.i % 100, 11..=14))
{
PluralCategory::MANY
} else if (po.v == 0 && po.i % 10 == 1 && po.i % 100 != 11) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_uk
}),
]),
};
LANGUAGES.get(lang_code).cloned().ok_or(())
}
PluralRuleType::ORDINAL => {
static LANGUAGES: phf::Map<&'static str, PluralRule> = ::phf::Map {
key: 3213172566270843353,
disps: ::phf::Slice::Static(&[
(0, 58),
(0, 0),
(0, 15),
(0, 2),
(17, 37),
(0, 20),
(2, 79),
(0, 33),
(14, 1),
(0, 0),
(1, 48),
(1, 4),
(0, 5),
(13, 74),
(4, 91),
(0, 2),
(3, 19),
(0, 21),
(26, 29),
(9, 50),
]),
entries: ::phf::Slice::Static(&[
("ta", {
fn rule_ta(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ta
}),
("in", {
fn rule_in(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_in
}),
("ru", {
fn rule_ru(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ru
}),
("pt", {
fn rule_pt(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_pt
}),
("eu", {
fn rule_eu(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_eu
}),
("sv", {
fn rule_sv(po: &PluralOperands) -> PluralCategory {
if ((po.i % 10 == 1 || po.i % 10 == 2)
&& po.i % 100 != 11
&& po.i % 100 != 12)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sv
}),
("lt", {
fn rule_lt(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_lt
}),
("cy", {
fn rule_cy(po: &PluralOperands) -> PluralCategory {
if (po.n == 3.0 || po.n == 4.0) {
PluralCategory::FEW
} else if (po.n == 5.0 || po.n == 6.0) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else if (po.n == 0.0 || po.n == 7.0 || po.n == 8.0 || po.n == 9.0) {
PluralCategory::ZERO
} else {
PluralCategory::OTHER
}
};
rule_cy
}),
("et", {
fn rule_et(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_et
}),
("ps", {
fn rule_ps(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ps
}),
("mo", {
fn rule_mo(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_mo
}),
("as", {
fn rule_as(po: &PluralOperands) -> PluralCategory {
if (po.n == 4.0) {
PluralCategory::FEW
} else if (po.n == 6.0) {
PluralCategory::MANY
} else if (po.n == 1.0
|| po.n == 5.0
|| po.n == 7.0
|| po.n == 8.0
|| po.n == 9.0
|| po.n == 10.0)
{
PluralCategory::ONE
} else if (po.n == 2.0 || po.n == 3.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_as
}),
("ia", {
fn rule_ia(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ia
}),
("km", {
fn rule_km(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_km
}),
("or", {
fn rule_or(po: &PluralOperands) -> PluralCategory {
if (po.n == 4.0) {
PluralCategory::FEW
} else if (po.n == 6.0) {
PluralCategory::MANY
} else if (po.n == 1.0
|| po.n == 5.0
|| matches!(po.i, 7..=9) && po.f == 0)
{
PluralCategory::ONE
} else if (po.n == 2.0 || po.n == 3.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_or
}),
("gu", {
fn rule_gu(po: &PluralOperands) -> PluralCategory {
if (po.n == 4.0) {
PluralCategory::FEW
} else if (po.n == 6.0) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0 || po.n == 3.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_gu
}),
("cs", {
fn rule_cs(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_cs
}),
("tr", {
fn rule_tr(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_tr
}),
("nl", {
fn rule_nl(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_nl
}),
("my", {
fn rule_my(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_my
}),
("th", {
fn rule_th(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_th
}),
("kk", {
fn rule_kk(po: &PluralOperands) -> PluralCategory {
if (po.i % 10 == 6)
|| (po.i % 10 == 9)
|| (po.i % 10 == 0 && po.n != 0.0)
{
PluralCategory::MANY
} else {
PluralCategory::OTHER
}
};
rule_kk
}),
("sk", {
fn rule_sk(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_sk
}),
("ky", {
fn rule_ky(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ky
}),
("mk", {
fn rule_mk(po: &PluralOperands) -> PluralCategory {
if ((po.i % 10 == 7 || po.i % 10 == 8)
&& po.i % 100 != 17
&& po.i % 100 != 18)
{
PluralCategory::MANY
} else if (po.i % 10 == 1 && po.i % 100 != 11) {
PluralCategory::ONE
} else if (po.i % 10 == 2 && po.i % 100 != 12) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_mk
}),
("prg", {
fn rule_prg(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_prg
}),
("dsb", {
fn rule_dsb(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_dsb
}),
("sh", {
fn rule_sh(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_sh
}),
("hr", {
fn rule_hr(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_hr
}),
("yue", {
fn rule_yue(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_yue
}),
("kw", {
fn rule_kw(po: &PluralOperands) -> PluralCategory {
if (po.n == 5.0) || (po.i % 100 == 5) {
PluralCategory::MANY
} else if (matches!(po.i, 1..=4) && po.f == 0)
|| (matches!(po.i, 1..=4)
|| matches!(po.i, 21..=24)
|| matches!(po.i, 41..=44)
|| matches!(po.i, 61..=64)
|| matches!(po.i, 81..=84))
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_kw
}),
("da", {
fn rule_da(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_da
}),
("sl", {
fn rule_sl(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_sl
}),
("sd", {
fn rule_sd(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_sd
}),
("ja", {
fn rule_ja(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ja
}),
("ko", {
fn rule_ko(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ko
}),
("sq", {
fn rule_sq(po: &PluralOperands) -> PluralCategory {
if (po.i % 10 == 4 && po.i % 100 != 14) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_sq
}),
("tk", {
fn rule_tk(po: &PluralOperands) -> PluralCategory {
if (po.i % 10 == 6 || po.i % 10 == 9) || (po.n == 10.0) {
PluralCategory::FEW
} else {
PluralCategory::OTHER
}
};
rule_tk
}),
("ga", {
fn rule_ga(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ga
}),
("mn", {
fn rule_mn(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_mn
}),
("scn", {
fn rule_scn(po: &PluralOperands) -> PluralCategory {
if (po.n == 11.0 || po.n == 8.0 || po.n == 80.0 || po.n == 800.0) {
PluralCategory::MANY
} else {
PluralCategory::OTHER
}
};
rule_scn
}),
("he", {
fn rule_he(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_he
}),
("en", {
fn rule_en(po: &PluralOperands) -> PluralCategory {
if (po.i % 10 == 3 && po.i % 100 != 13) {
PluralCategory::FEW
} else if (po.i % 10 == 1 && po.i % 100 != 11) {
PluralCategory::ONE
} else if (po.i % 10 == 2 && po.i % 100 != 12) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_en
}),
("ms", {
fn rule_ms(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ms
}),
("az", {
fn rule_az(po: &PluralOperands) -> PluralCategory {
if (po.i % 10 == 3 || po.i % 10 == 4)
|| (po.i % 1000 == 100
|| po.i % 1000 == 200
|| po.i % 1000 == 300
|| po.i % 1000 == 400
|| po.i % 1000 == 500
|| po.i % 1000 == 600
|| po.i % 1000 == 700
|| po.i % 1000 == 800
|| po.i % 1000 == 900)
{
PluralCategory::FEW
} else if (po.i == 0)
|| (po.i % 10 == 6)
|| (po.i % 100 == 40 || po.i % 100 == 60 || po.i % 100 == 90)
{
PluralCategory::MANY
} else if (po.i % 10 == 1
|| po.i % 10 == 2
|| po.i % 10 == 5
|| po.i % 10 == 7
|| po.i % 10 == 8)
|| (po.i % 100 == 20
|| po.i % 100 == 50
|| po.i % 100 == 70
|| po.i % 100 == 80)
{
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_az
}),
("fy", {
fn rule_fy(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_fy
}),
("bg", {
fn rule_bg(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_bg
}),
("fa", {
fn rule_fa(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_fa
}),
("be", {
fn rule_be(po: &PluralOperands) -> PluralCategory {
if ((po.i % 10 == 2 || po.i % 10 == 3)
&& po.i % 100 != 12
&& po.i % 100 != 13)
{
PluralCategory::FEW
} else {
PluralCategory::OTHER
}
};
rule_be
}),
("pa", {
fn rule_pa(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_pa
}),
("hi", {
fn rule_hi(po: &PluralOperands) -> PluralCategory {
if (po.n == 4.0) {
PluralCategory::FEW
} else if (po.n == 6.0) {
PluralCategory::MANY
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0 || po.n == 3.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_hi
}),
("root", {
fn rule_root(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_root
}),
("fil", {
fn rule_fil(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fil
}),
("gl", {
fn rule_gl(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_gl
}),
("uz", {
fn rule_uz(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_uz
}),
("de", {
fn rule_de(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_de
}),
("it", {
fn rule_it(po: &PluralOperands) -> PluralCategory {
if (po.n == 11.0 || po.n == 8.0 || po.n == 80.0 || po.n == 800.0) {
PluralCategory::MANY
} else {
PluralCategory::OTHER
}
};
rule_it
}),
("nb", {
fn rule_nb(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_nb
}),
("ml", {
fn rule_ml(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ml
}),
("is", {
fn rule_is(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_is
}),
("ce", {
fn rule_ce(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ce
}),
("el", {
fn rule_el(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_el
}),
("zh", {
fn rule_zh(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_zh
}),
("sw", {
fn rule_sw(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_sw
}),
("gd", {
fn rule_gd(po: &PluralOperands) -> PluralCategory {
if (po.n == 3.0 || po.n == 13.0) {
PluralCategory::FEW
} else if (po.n == 1.0 || po.n == 11.0) {
PluralCategory::ONE
} else if (po.n == 2.0 || po.n == 12.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_gd
}),
("ca", {
fn rule_ca(po: &PluralOperands) -> PluralCategory {
if (po.n == 4.0) {
PluralCategory::FEW
} else if (po.n == 1.0 || po.n == 3.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_ca
}),
("hy", {
fn rule_hy(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_hy
}),
("id", {
fn rule_id(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_id
}),
("lo", {
fn rule_lo(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_lo
}),
("hu", {
fn rule_hu(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0 || po.n == 5.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_hu
}),
("bn", {
fn rule_bn(po: &PluralOperands) -> PluralCategory {
if (po.n == 4.0) {
PluralCategory::FEW
} else if (po.n == 6.0) {
PluralCategory::MANY
} else if (po.n == 1.0
|| po.n == 5.0
|| po.n == 7.0
|| po.n == 8.0
|| po.n == 9.0
|| po.n == 10.0)
{
PluralCategory::ONE
} else if (po.n == 2.0 || po.n == 3.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_bn
}),
("uk", {
fn rule_uk(po: &PluralOperands) -> PluralCategory {
if (po.i % 10 == 3 && po.i % 100 != 13) {
PluralCategory::FEW
} else {
PluralCategory::OTHER
}
};
rule_uk
}),
("kn", {
fn rule_kn(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_kn
}),
("te", {
fn rule_te(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_te
}),
("sr", {
fn rule_sr(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_sr
}),
("gsw", {
fn rule_gsw(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_gsw
}),
("ro", {
fn rule_ro(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ro
}),
("ka", {
fn rule_ka(po: &PluralOperands) -> PluralCategory {
if (po.i == 0)
|| (po.i % 100 == 40
|| po.i % 100 == 60
|| po.i % 100 == 80
|| matches!(po.i % 100, 2..=20))
{
PluralCategory::MANY
} else if (po.i == 1) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ka
}),
("lv", {
fn rule_lv(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_lv
}),
("af", {
fn rule_af(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_af
}),
("ur", {
fn rule_ur(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ur
}),
("fi", {
fn rule_fi(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_fi
}),
("iw", {
fn rule_iw(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_iw
}),
("si", {
fn rule_si(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_si
}),
("bs", {
fn rule_bs(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_bs
}),
("fr", {
fn rule_fr(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_fr
}),
("sc", {
fn rule_sc(po: &PluralOperands) -> PluralCategory {
if (po.n == 11.0 || po.n == 8.0 || po.n == 80.0 || po.n == 800.0) {
PluralCategory::MANY
} else {
PluralCategory::OTHER
}
};
rule_sc
}),
("pl", {
fn rule_pl(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_pl
}),
("tl", {
fn rule_tl(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_tl
}),
("zu", {
fn rule_zu(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_zu
}),
("vi", {
fn rule_vi(po: &PluralOperands) -> PluralCategory {
if (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_vi
}),
("es", {
fn rule_es(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_es
}),
("hsb", {
fn rule_hsb(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_hsb
}),
("ne", {
fn rule_ne(po: &PluralOperands) -> PluralCategory {
if (matches!(po.i, 1..=4) && po.f == 0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
};
rule_ne
}),
("mr", {
fn rule_mr(po: &PluralOperands) -> PluralCategory {
if (po.n == 4.0) {
PluralCategory::FEW
} else if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0 || po.n == 3.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
};
rule_mr
}),
("ar", {
fn rule_ar(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_ar
}),
("am", {
fn rule_am(po: &PluralOperands) -> PluralCategory {
{
PluralCategory::OTHER
}
};
rule_am
}),
]),
};
LANGUAGES.get(lang_code).cloned().ok_or(())
}
}
}