Z19630

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z19630"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z19629",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z610",
            "Z16K2": "def Z19629(Z19629K1):\n\tif Z19629K1 == 0:\n\t\treturn \"الصفر\"\n\tdef get_cardinal_arabic(n):\n\t\t\"\"\"\n\t\tThis function converts a number to its Standard Arabic representation.\n\t\tIt would definitely break for super large numbers which have no\n\t\tcorresponding representation. Add more elements to \"orders\"\n\t\tif you want it to work for larger numbers (eventually you'll\n\t\tget a stack overflow or timeout though).\n\t\t\"\"\"\n\n\t\tAND = \" و\"\n\t\tT_MARBOUTA = \"ة\"\n\t\tDUAL_FORM = \"ان\"\n\t\tFEM_PLURAL = \"ات\"\n\t\tACC_FORM = \"اً\"\n\t\tunits = [\"صفر\", \"واحد\", \"إثنين\", \"ثلاث\", \"أربع\", \"خمس\", \"ست\", \"سبع\", \"ثماني\", \"تسع\"]\n\t\tteens = [\"عشرة\", \"أحد عشر\", \"إثني عشر\", \"ثلاثة عشر\", \"أربعة عشر\", \"خمسة عشر\", \"ستة عشر\", \"سبعة عشر\", \"ثمانية عشر\", \"تسعة عشر\"]\n\t\ttens = [\"\", \"عشرة\", \"عشرين\", \"ثلاثين\", \"أربعين\", \"خمسين\", \"ستين\", \"سبعين\", \"ثمانين\", \"تسعين\"]\n\n\t\thundred = \"مئة\"\n\t\ttwo_hundreds = \"مئتين\"\n\n\t\torders = [\"\",\"ألف\",\"مليون\",\"مليار\",\"تريليون\",\"كوادريليون\",\"كوينتيليون\",\"سيكستيليون\"\n\t\t\t\t\t,\"سيبتيليون\",\"أوكتيليون\",\"نونيليون\",\"ديسيليون\",\"دودشيليون\",\"تريدشيليون\",\"كواتوردشيليون\"\n\t\t\t\t\t,\"كويندشيليون\",\"سكسدشيليون\",\"سبتندشيليون\",\"أوكتودشيليون\",\"نوفمدشيليون\",\"فجنتليون\"]\n\n\t\torders_plural = [\"\", \"آلاف\", \"ملايين\", \"ملايير\"]\n\n\t\tdef convert_number(n):\n\t\t\tif n == 0:\n\t\t\t\treturn \"\"\n\t\t\telif n \u003C 3:\n\t\t\t\treturn units[n]\n\t\t\telif n \u003C 10:\n\t\t\t\treturn units[n]+T_MARBOUTA\n\t\t\telif n \u003C 20:\n\t\t\t\treturn teens[n - 10]\n\t\t\telif n \u003C 100:\n\t\t\t\tif n % 10 == 0:\n\t\t\t\t\treturn tens[n // 10]\n\t\t\t\telse:\n\t\t\t\t\tif n % 10 \u003C 3:\n\t\t\t\t\t\treturn units[n % 10] + AND + tens[n // 10]\n\t\t\t\t\treturn units[n % 10]+T_MARBOUTA + AND + tens[n // 10]\n\t\t\telse: #elif n \u003C 1000:\n\t\t\t\tif n % 100 == 0:\n\t\t\t\t\tif n // 100 == 1:\n\t\t\t\t\t\treturn hundred\n\t\t\t\t\telif n // 100 == 2:\n\t\t\t\t\t\treturn two_hundreds\n\t\t\t\t\telif n // 100 == 8:\n\t\t\t\t\t\treturn units[8][:-1]+\" \"+hundred\n\t\t\t\t\treturn units[n // 100]+\" \"+hundred\n\t\t\t\telse:\n\t\t\t\t\tif n // 100 == 1:\n\t\t\t\t\t\treturn hundred + AND + convert_number(n % 100)\n\t\t\t\t\telif n // 100 == 2:\n\t\t\t\t\t\treturn two_hundreds + AND + convert_number(n % 100)\n\t\t\t\t\telif n // 100 == 8:\n\t\t\t\t\t\treturn units[8][:-1]+\" \"+hundred + AND + convert_number(n % 100)\n\t\t\t\t\treturn units[n // 100]+\" \"+hundred + AND + convert_number(n % 100)\n\n\t\tdef convert_large_number(n):\n\t\t\tif n \u003C 1000:\n\t\t\t\treturn convert_number(n)\n\n\t\t\tfor order in range(len(orders) - 1, 0, -1):\n\t\t\t\torder_value = 10 ** (order * 3)\n\t\t\t\tif n \u003E= order_value:\n\t\t\t\t\tmajor_part = n // order_value\n\t\t\t\t\tremainder = n % order_value\n\t\t\t\t\tmajor_part_str = convert_number(major_part)\n\t\t\t\t\tremainder_str = convert_large_number(remainder)\n\t\t\t\t\torder_name = orders[order]\n\n\t\t\t\t\tif major_part == 1:\n\t\t\t\t\t\treturn (orders[order] + (AND + remainder_str if remainder else \"\")).strip()\n\t\t\t\t\telif major_part == 2:\n\t\t\t\t\t\treturn (orders[order]+ DUAL_FORM + \" \" + (AND + remainder_str if remainder else \"\")).strip()\n\t\t\t\t\telif major_part % 100 \u003C 11:\n\t\t\t\t\t\tif order \u003C 4:\n\t\t\t\t\t\t\treturn (major_part_str + \" \" + orders_plural[order] + (AND + remainder_str if remainder else \"\")).strip()\n\t\t\t\t\t\treturn (major_part_str + \" \" + orders[order]+FEM_PLURAL + (AND + remainder_str if remainder else \"\")).strip()\n\n\t\t\t\t\treturn (major_part_str + \" \" + order_name+ACC_FORM + (AND + remainder_str if remainder else \"\")).strip()\n                    \n\t\treturn convert_large_number(n)\n\tdef get_ordinal_below_100(n):\n\t\tarabic_units_definite = [\"\", \"الأول\", \"الثاني\", \"الثالث\", \"الرابع\", \"الخامس\", \"السادس\", \"السابع\", \"الثامن\", \"التاسع\"]\n\t\tarabic_teens_definite = [\"العاشر\", \"الحادي عشر\", \"الثاني عشر\", \"الثالث عشر\", \"الرابع عشر\", \"الخامس عشر\", \"السادس عشر\", \"السابع عشر\", \"الثامن عشر\", \"التاسع عشر\"]\n\t\tarabic_tens_definite = [\"\", \"العاشر\", \"العشرون\", \"الثلاثون\", \"الأربعون\", \"الخمسون\", \"الستون\", \"السبعون\", \"الثمانون\", \"التسعون\"]\n\n\t\tif n \u003C 10:\n\t\t\treturn arabic_units_definite[n]\n\t\telif n \u003C 20:\n\t\t\treturn arabic_teens_definite[n - 10]\n\t\telse:\n\t\t\tunit = n % 10\n\t\t\ttens = n // 10\n\t\t\tif unit == 1:\n\t\t\t\treturn \"الحادي\" + \" و\" + arabic_tens_definite[tens]\n\t\t\telif unit == 0:\n\t\t\t\treturn arabic_tens_definite[tens]\n\t\t\telse:\n\t\t\t\treturn arabic_units_definite[unit] + \" و\" + arabic_tens_definite[tens]\n\n\tif Z19629K1 \u003C 100:\n\t\treturn get_ordinal_below_100(Z19629K1)\n\telif Z19629K1 % 100 == 0:\n\t\t# Use the cardinal function for the definite form of n if divisible by 100\n\t\treturn 'ال'+get_cardinal_arabic(Z19629K1)\n\telse:\n\t\t# Get the cardinal for the higher segment and ordinal for the last two digits\n\t\thigher_segment = get_cardinal_arabic(Z19629K1 - (Z19629K1 % 100))\n\t\tordinal_segment = get_ordinal_below_100(Z19629K1 % 100)\n\t\treturn f\"{ordinal_segment} بعد ال{higher_segment}\""
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Standard Arabic ordinal, python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1672",
                "Z11K2": "標準阿拉伯語序數, python"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}