Z19415

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z19415"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z16409",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z600",
            "Z16K2": "function Z16409(Z16409K1) {\n\n  function simplifiedEifelRule(word1, word2) {\n    // Define the characters that, if the second word starts with, we won't remove 'n's\n    const nonRemovalStartChars = new Set([\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\" || word1.endsWith(\"en\")) \u0026\u0026\n      !nonRemovalStartChars.has(word2[0].toLowerCase())) {\n      word1 = word1.slice(0, -1);\n    }\n    return word1;\n  }\n\n  function applySimplifiedEifelRuleToString(s) {\n    const words = s.trim().split(' ');\n    if (words.length \u003C 2) {\n      return s;\n    }\n    const result = [];\n    for (let i = 0; i \u003C words.length - 1; i++) {\n      result.push(simplifiedEifelRule(words[i], words[i + 1]));\n    }\n    result.push(words[words.length - 1]); // Append the last word as it is\n    return result.join(' ');\n  }\n\n  const smallNumbers = [\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  const tens = [\n    \"\", \"\", \"zwanzeg\", \"drësseg\", \"véierzeg\", \"fofzeg\", \"sechzeg\",\n    \"siwwenzeg\", \"achtzeg\", \"nonzeg\"\n  ];\n  const largeNumbers = [\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  function convertTwoDigitNumber(n) {\n    // Converts numbers !=0 with _up to_ two digits and returns \"\" for n==0.\n    if (n \u003C 20) {\n      return smallNumbers[n];\n    }\n    const quotient = Math.floor(n / 10); // note that quotient \u003E= 2\n    const remainder = n % 10;\n    let part1 = \"\";\n    let part2 = \"\";\n    const part3 = tens[quotient];\n    if (remainder \u003E= 1) {\n      part1 = remainder === 1 ? \"een\" : smallNumbers[remainder];\n      part2 = simplifiedEifelRule(\"an\", part3);\n    }\n    return part1 + part2 + part3;\n  }\n\n  function convertThreeDigitNumber(n) {\n    // Converts numbers !=0 with _up to_ three digits and returns \"\" for n==0.\n    if (n \u003C 100) {\n      return convertTwoDigitNumber(n);\n    }\n    const quotient = Math.floor(n / 100); // note that quotient \u003E= 1\n    const remainder = n % 100;\n    const prefix = quotient === 1 ? \"\" : smallNumbers[quotient];\n    return prefix + \"honnert\" + convertTwoDigitNumber(remainder);\n  }\n\n  function convertLargeNumber(n) {\n    // Converts numbers with _up to_ 23 digits and returns \"\" for n==0.\n    if (String(Math.abs(n)).length \u003E 23) {\n      return \"ERROR: the input number is too large for this function\";\n    }\n    if (n \u003C 1000) {\n      return convertThreeDigitNumber(n);\n    }\n    let blockIndex = 0; // one block equals three digits; indexing from right to left\n    let result = \"\";\n    while (n \u003E 0) {\n      const remainder = n % 1000;\n      n = Math.floor(n / 1000);\n      if (blockIndex === 0) {\n        result = convertThreeDigitNumber(remainder);\n      } else if (blockIndex === 1 \u0026\u0026 remainder \u003E= 1) {\n        const prefix = remainder === 1 ? \"\" : convertThreeDigitNumber(remainder);\n        result = prefix + \"dausend\" + result;\n      } else if (remainder \u003E= 1) {\n        const prefix = (remainder === 1 || remainder === 2) ?\n          (remainder === 1 ? \"eng\" : \"zwou\") :\n          convertThreeDigitNumber(remainder);\n        const ending = remainder === 1 ? \" \" : \"en \";\n        result = prefix + \" \" + largeNumbers[blockIndex] + ending + result;\n      }\n      blockIndex += 1;\n    }\n    return result;\n  }\n\n  const n = Number(Z16409K1);\n  if (n === 0) {\n    return \"null\";\n  }\n  return applySimplifiedEifelRuleToString(convertLargeNumber(n));\n}"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Luxembourgish cardinal javascript"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "cardinal en luxembourgeois, en JavaScript"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}