Z23864

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z23864"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z23855",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z610",
            "Z16K2": "def Z23855(Z23855K1):\n    def simplified_eifel_rule(word1, word2):\n        # Define the characters that, if the second word starts with, we won't remove 'n's\n        non_removal_start_chars = {\n            'd', 'h', 'n', 't', 'z', 'a', 'e', 'i', 'o', 'u', 'ä', 'ö', 'ü'\n        }\n    \n        # Check if the first word is \"an\" or ends with 'en' and if the second word\n        # starts with any character that prevents removal\n        if (word1 == \"an\" or word1.endswith(\"en\")) and word2[0].lower() not in non_removal_start_chars:\n            word1 = word1[:-1]\n        return word1\n\n    def apply_simplified_eifel_rule_to_string(s):\n        words = s.split()\n        if len(words) \u003C 2:\n            return s\n        result = [\n            simplified_eifel_rule(words[i], words[i + 1])\n            for i in range(len(words) - 1)\n        ]\n        result.append(words[-1])  # Append the last word as it is\n        return ' '.join(result)\n\n    small_ordinals = [\n        \"st\", \"éischt\", \"zweet\", \"drëtt\", \"véiert\", \"fënneft\", \"sechst\", \"siwent\",\n        \"aacht\", \"néngt\", \"zéngt\", \"eeleft\", \"zwieleft\", \"dräizéngt\", \"véierzéngt\",\n        \"fofzéngt\", \"siechzéngt\", \"siwwenzéngt\", \"uechzéngt\", \"nonzéngt\"\n    ]\n\n    small_numbers = [\n        \"\", \"eent\", \"zwee\", \"dräi\", \"véier\", \"fënnef\", \"sechs\", \"siwen\",\n        \"aacht\", \"néng\", \"zéng\", \"eelef\", \"zwielef\", \"dräizéng\", \"véierzéng\",\n        \"fofzéng\", \"siechzéng\", \"siwwenzéng\", \"uechzéng\", \"nonzéng\"\n    ]\n    tens = [\n        \"\", \"\", \"zwanzeg\", \"drësseg\", \"véierzeg\", \"fofzeg\", \"sechzeg\",\n        \"siwwenzeg\", \"achtzeg\", \"nonzeg\"\n    ]\n    large_numbers = [\n        \"\", \"\", \"millioun\", \"milliard\", \"billioun\", \"billiard\", \"trillioun\",\n        \"trilliard\", \"quadrillioun\", \"quadrilliard\", \"quintillioun\",\n        \"quintilliard\", \"sextillioun\", \"sextilliard\", \"septillioun\",\n        \"septilliard\", \"oktillioun\", \"oktilliard\", \"nonillioun\", \"nonilliard\",\n        \"dezillioun\"\n    ]\n\n    def convert_two_digit_number(n, block_index):\n        if n \u003C 20:\n            return small_ordinals[n] if block_index == 0 else small_numbers[n]\n        quotient, remainder = divmod(n, 10)  # note that quotient \u003E= 2\n        part1, part2, part3 = \"\", \"\", tens[quotient]\n        if remainder \u003E= 1:\n            part1 = \"een\" if remainder == 1 else small_numbers[remainder]\n            part2 = simplified_eifel_rule(\"an\", part3)\n        return part1 + part2 + part3 + (\"st\" if block_index == 0 else \"\")\n\n    def convert_three_digit_number(n, block_index):\n        # Converts numbers !=0 with _up to_ three digits and returns \"\" for n==0.\n        if n \u003C 100:\n            return convert_two_digit_number(n, block_index)\n        quotient, remainder = divmod(n, 100)  # note that quotient \u003E= 1\n        prefix = \"\" if quotient == 1 else small_numbers[quotient]\n        return prefix + \"honnert\" + convert_two_digit_number(remainder, block_index)\n\n    def convert_large_number(n):\n        # Converts numbers with _up to_ 23 digits and returns \"\" for n==0.\n        if len(str(abs(n))) \u003E 23:\n            return \"ERROR: the input number is too large for this function\"\n        if n \u003C 1_000:\n            return convert_three_digit_number(n, block_index=0)\n        block_index = 0  # one block equals three digits; indexing from right to left\n        result = \"\"\n        while n \u003E 0:\n            n, remainder = divmod(n, 1000)\n            if block_index == 0:\n                result = convert_three_digit_number(remainder, block_index=block_index)\n            elif block_index == 1 and remainder \u003E= 1:\n                prefix = \"\" if remainder == 1 else convert_three_digit_number(\n                    remainder, block_index=block_index\n                    )\n                result = prefix + \"dausend\" + result\n            elif remainder \u003E= 1:\n                prefix = {1: \"eng\", 2: \"zwou\"}.get(remainder,\n                                                convert_three_digit_number(remainder,\n                                                                          block_index=block_index)\n                                                )\n                ending = \"\" if remainder == 1 else \"en\"\n                suffix = \"\" if result == \"st\" else ending\n                result = prefix + large_numbers[block_index] + suffix + result\n            block_index += 1\n        return result\n\n    n = Z23855K1\n    if n == 0:\n        return \"nullt\"\n    return apply_simplified_eifel_rule_to_string(convert_large_number(n))"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Luxembourgish ordinal, Python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1099",
                "Z11K2": "Lëtzebuergesch Ordinalzuel, Python"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}