Z12628

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z12628"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z12627",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z610",
            "Z16K2": "def Z12627(Z12627K1):\r\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"]\r\n otherVowels = [\"au\", \"ou\", \"ij\", \"ei\", \"ui\", \"oei\", \"ieu\", \"ooi\", \"aai\", \"eeu\", \"eu\", \"ie\", \"oe\"]\r\n foreignDiphthongs = [\"eaa\", \"ea\", \"ioo\", \"io\"]\r\n vowelEncountered = False\r\n consonantEncountered = False\r\n length = len(Z12627K1)\r\n onset = \"\"\r\n nucleus = \"\"\r\n coda = \"\"\r\n plural = \"\"\r\n \r\n for letter in Z12627K1[::-1].lower():\r\n  if letter in vowels:\r\n   if vowelEncountered and consonantEncountered:\r\n    break;\r\n   else:\r\n    consonantEncountered = False\r\n    vowelEncountered = True\r\n   nucleus = letter + nucleus\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  length -= 1\r\n  \r\n exceptions_e = [\"gevangene\", \"gelovige\", \"heilige\", \"bejaarde\", \"getuige\", \"afgevaardigde\", \"voorwaarde\", \"volwassene\"]\r\n exceptions_s = [\"kaars\", \"wals\", \"kruis\"]\r\n exceptions_length = [\"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 exceptions_eConsonant = [\"heiden\", \"christen\", \"engel\", \"reden\", \"artikel\", \"schepen\"]\r\n exceptions_endings = [\"den\", \"blaar\", \"leraar\", \"gevaar\", \"schaar\", \"jaar\", \"calorie\", \"kopie\", \"knie\", \"tabel\", \"toestel\", \"rebel\", \"loket\", \"raket\", \"kroket\"] + exceptions_eConsonant\r\n exceptions_vowelMutation = [\"stad\", \"smid\", \"schip\", \"lid\"]\r\n exceptions_eren = [\"kind\", \"ei\", \"blad\", \"rad\", \"kalf\", \"lam\", \"volk\", \"lied\", \"rund\"]\r\n exceptions_Latin = [\"museum\"]\r\n exceptions = [\"olie\", \"la\", \"hoen\", \"dagje\", \"gevoel\", \"excuus\", \"koe\", \"vlo\"]\r\n exceptionPlurals = [\"oliën\", \"laden\", \"hoenderen\", \"daagjes\", \"gevoelens\", \"excuses\", \"koeien\", \"vlooien\"]\r\n \r\n if len(coda) != 0 and len(nucleus) != 0 and coda[0] == \"j\" and nucleus[-1] == \"i\":\r\n  coda = coda[1:]\r\n  nucleus += \"j\"\r\n if nucleus in foreignDiphthongs:\r\n  length += len(onset)\r\n  length += 1\r\n  onset = \"\"\r\n  nucleus = nucleus[1:]\r\n if Z12627K1 in exceptions_length:\r\n  nucleus *= 2\r\n if Z12627K1 in exceptions_vowelMutation or Z12627K1 in exceptions_eConsonant:\r\n  nucleus = \"ee\"\r\n  \r\n if \"cus\" in onset + nucleus + coda:\r\n  plural = \"i\"\r\n  nucleus = \"\"\r\n  coda = \"\"\r\n else:\r\n  if Z12627K1 in exceptions_Latin:\r\n   plural = \"a\"\r\n   nucleus = \"\"\r\n   coda = \"\"\r\n  if Z12627K1 in exceptions_e:\r\n   plural = \"n\"\r\n  elif ((nucleus == \"e\" and len(coda) \u003C 2 and coda != \"s\") or nucleus + coda == \"aar\" or nucleus + coda == \"ium\" or nucleus + coda == \"ie\") and Z12627K1 not in exceptions_endings:\r\n   plural = \"s\"\r\n  elif coda == \"\" and nucleus not in otherVowels and (nucleus + coda)[-1] != \"e\":\r\n   plural = \"'s\"\r\n  else:\r\n   plural = \"en\"\r\n   if \"heid\" in onset + nucleus + coda:\r\n    nucleus = \"ee\"\r\n   if len(coda) != 0:\r\n    if coda[-1] == \"f\":\r\n     coda = coda[:-1] + \"v\"\r\n    elif coda[-1] == \"s\" and Z12627K1 not in exceptions_s and len(nucleus) != 1:\r\n     coda = coda[:-1] + \"z\"\r\n   if (nucleus + coda)[-1] == \"e\":\r\n    plural = \"ën\"\r\n   if len(coda) == 1:\r\n    if len(nucleus) == 1 and nucleus != \"y\":\r\n     coda *= 2\r\n    elif nucleus not in otherVowels:\r\n     nucleus = nucleus[0]\r\n   if Z12627K1 in exceptions_eren:\r\n    plural = \"eren\"\r\n \r\n final = Z12627K1[:length:] + onset + nucleus + coda + plural\r\n if Z12627K1[0].isupper():\r\n  final = final[0].upper() + final[1:]\r\n if Z12627K1 in exceptions:\r\n  final = exceptionPlurals[exceptions.index(Z12627K1)]\r\n return final"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Python Dutch plural"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1014",
                "Z11K2": "Python Dutch ọtụtụ"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1430",
                "Z11K2": "niederländischer Plural in Python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "pluriel en néerlandais, en Python"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Rules taken from https://www.heardutchhere.net/plurals.html"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1014",
                "Z11K2": "Iwu ewepụtara na https://www.heardutchhere.net/plurals.html"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1430",
                "Z11K2": "Python-Implementierung der Funktion für den niederländischen Plural"
            }
        ]
    }
}