class PluralRules:
    """CLDR-based pluralization category selector."""

    @staticmethod
    def get_category(locale: str, count: int | float) -> str:
        count = abs(count)
        base_locale = locale.split("-")[0].lower()

        if base_locale in ("en", "de", "es", "hi", "hi-latn", "bn", "gu", "mr", "ta", "te", "sa"):
            if count == 1:
                return "one"
            return "other"

        elif base_locale in ("fr",):
            if count in (0, 1):
                return "one"
            return "other"


        elif base_locale in ("ar",):
            # Arabic plural rules
            if count == 0:
                return "zero"
            elif count == 1:
                return "one"
            elif count == 2:
                return "two"
            elif 3 <= count % 100 <= 10:
                return "few"
            elif 11 <= count % 100 <= 99:
                return "many"
            else:
                return "other"

        elif base_locale in ("ru", "ur"):
            mod10 = count % 10
            mod100 = count % 100
            if mod10 == 1 and mod100 != 11:
                return "one"
            elif 2 <= mod10 <= 4 and not (12 <= mod100 <= 14):
                return "few"
            else:
                return "many"

        elif base_locale in ("ja",):
            return "other"

        return "other"
