Z19434

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z19434"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z12627",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z600",
            "Z16K2": "function Z12627(Z12627K1) {\r\n    let word = Z12627K1\r\n    const vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"];\r\n    const otherVowels = [\"au\", \"ou\", \"ij\", \"ei\", \"ui\", \"oei\", \"ieu\", \"ooi\", \"aai\", \"eeu\", \"eu\", \"ie\", \"oe\"];\r\n    const foreignDiphthongs = [\"eaa\", \"ea\", \"ioo\", \"io\"];\r\n\r\n    let vowelEncountered = false;\r\n    let consonantEncountered = false;\r\n    let length = word.length;\r\n    let onset = \"\";\r\n    let nucleus = \"\";\r\n    let coda = \"\";\r\n    let plural = \"\";\r\n\r\n    for (let i = length - 1; i \u003E= 0; i--) {\r\n        const letter = word[i].toLowerCase();\r\n        if (vowels.includes(letter)) {\r\n            if (vowelEncountered \u0026\u0026 consonantEncountered) {\r\n                break;\r\n            } else {\r\n                consonantEncountered = false;\r\n                vowelEncountered = true;\r\n                nucleus = letter + nucleus;\r\n            }\r\n        } else {\r\n            consonantEncountered = true;\r\n            if (vowelEncountered) {\r\n                onset = letter + onset;\r\n            } else {\r\n                coda = letter + coda;\r\n            }\r\n        }\r\n        length--;\r\n    }\r\n\r\n    const exceptionsE = [\"gevangene\", \"gelovige\", \"heilige\", \"bejaarde\", \"getuige\", \"afgevaardigde\", \"voorwaarde\", \"volwassene\"];\r\n    const exceptionsS = [\"kaars\", \"wals\", \"kruis\"];\r\n    const exceptionsLength = [\"glas\", \"blad\", \"rad\", \"bad\", \"pad\", \"dal\", \"dak\", \"dag\", \"slag\", \"verdrag\", \"bedrag\", \"graf\", \"gat\", \"vat\", \"gebed\", \"gebrek\", \"spel\", \"bevel\", \"gen\", \"schot\", \"god\", \"gebod\", \"lot\", \"slot\", \"hof\", \"hol\", \"ion\", \"hertog\", \"doctor\", \"professor\", \"ventilator\", \"transformator\"];\r\n    const exceptionsEConsonant = [\"heiden\", \"christen\", \"engel\", \"reden\", \"artikel\", \"schepen\"];\r\n    const exceptionsEndings = [\"den\", \"blaar\", \"leraar\", \"gevaar\", \"schaar\", \"jaar\", \"calorie\", \"kopie\", \"knie\", \"tabel\", \"toestel\", \"rebel\", \"loket\", \"raket\", \"kroket\", ...exceptionsEConsonant];\r\n    const exceptionsVowelMutation = [\"stad\", \"smid\", \"schip\", \"lid\"];\r\n    const exceptionsEren = [\"kind\", \"ei\", \"blad\", \"rad\", \"kalf\", \"lam\", \"volk\", \"lied\", \"rund\"];\r\n    const exceptionsLatin = [\"museum\"];\r\n    const exceptions = [\"olie\", \"la\", \"hoen\", \"dagje\", \"gevoel\", \"excuus\", \"koe\", \"vlo\"];\r\n    const exceptionPlurals = [\"oliën\", \"laden\", \"hoenderen\", \"daagjes\", \"gevoelens\", \"excuses\", \"koeien\", \"vlooien\"];\r\n\r\n    if (coda.length !== 0 \u0026\u0026 nucleus.length !== 0 \u0026\u0026 coda[0] === \"j\" \u0026\u0026 nucleus[nucleus.length - 1] === \"i\") {\r\n        coda = coda.slice(1);\r\n        nucleus += \"j\";\r\n    }\r\n    if (foreignDiphthongs.includes(nucleus)) {\r\n        length += onset.length + 1;\r\n        onset = \"\";\r\n        nucleus = nucleus.slice(1);\r\n    }\r\n    if (exceptionsLength.includes(word)) {\r\n        nucleus += nucleus;\r\n    }\r\n    if (exceptionsVowelMutation.includes(word) || exceptionsEConsonant.includes(word)) {\r\n        nucleus = \"ee\";\r\n    }\r\n\r\n    if (onset + nucleus + coda.includes(\"cus\")) {\r\n        plural = \"i\";\r\n        nucleus = \"\";\r\n        coda = \"\";\r\n    } else {\r\n        if (exceptionsLatin.includes(word)) {\r\n            plural = \"a\";\r\n            nucleus = \"\";\r\n            coda = \"\";\r\n        }\r\n        if (exceptionsE.includes(word)) {\r\n            plural = \"n\";\r\n        } else if ((nucleus === \"e\" \u0026\u0026 coda.length \u003C 2 \u0026\u0026 coda !== \"s\") || nucleus + coda === \"aar\" || nucleus + coda === \"ium\" || nucleus + coda === \"ie\") {\r\n            if (!exceptionsEndings.includes(word)) {\r\n                plural = \"s\";\r\n            }\r\n        } else if (coda === \"\" \u0026\u0026 !otherVowels.includes(nucleus) \u0026\u0026 (nucleus + coda).slice(-1) !== \"e\") {\r\n            plural = \"'s\";\r\n        } else {\r\n            plural = \"en\";\r\n            if (onset + nucleus + coda.includes(\"heid\")) {\r\n                nucleus = \"ee\";\r\n            }\r\n            if (coda.length !== 0) {\r\n                if (coda[coda.length - 1] === \"f\") {\r\n                    coda = coda.slice(0, -1) + \"v\";\r\n                } else if (coda[coda.length - 1] === \"s\" \u0026\u0026 !exceptionsS.includes(word) \u0026\u0026 nucleus.length !== 1) {\r\n                    coda = coda.slice(0, -1) + \"z\";\r\n                }\r\n            }\r\n            if ((nucleus + coda).slice(-1) === \"e\") {\r\n                plural = \"ën\";\r\n            }\r\n            if (coda.length === 1) {\r\n                if (nucleus.length === 1 \u0026\u0026 nucleus !== \"y\") {\r\n                    coda += coda;\r\n                } else if (!otherVowels.includes(nucleus)) {\r\n                    nucleus = nucleus[0];\r\n                }\r\n            }\r\n            if (exceptionsEren.includes(word)) {\r\n                plural = \"eren\";\r\n            }\r\n        }\r\n    }\r\n\r\n    let final = word.slice(0, length) + onset + nucleus + coda + plural;\r\n    if (word[0] === word[0].toUpperCase()) {\r\n        final = final.charAt(0).toUpperCase() + final.slice(1);\r\n    }\r\n    if (exceptions.includes(word)) {\r\n        final = exceptionPlurals[exceptions.indexOf(word)];\r\n    }\r\n    return final;\r\n}\r\n"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Dutch plural Javascript"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "pluriel en néerlandais, en JavaScript"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}