Z31844

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z31844"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z11089",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z610",
            "Z16K2": "def Z11089(Z11089K1):\n\t# Variables\n\tsing = Z11089K1\n\tsin = sing.lower()\n\tvowels = \"aeiou\"\n\tin_law = *\n\t# Number of vowel groups\n\tvowel_num = 0\n\tin_vowel_group = False\n\tfor c in sin:\n\t\tif c in vowels:\n\t\t\tif in_vowel_group == False:\n\t\t\t\tvowel_num += 1\n\t\t\t\tin_vowel_group = True\n\t\telse:\n\t\t\tin_vowel_group = False\n\t# Overall exceptions\n\texceptions = {\n\t\t# English\n\t\t\"child\":\"children\",\n\t\t\"sheep\":\"sheep\",\n\t\t\"ox\":\"oxen\",\n\t\t\"tooth\":\"teeth\",\n\t\t\"goose\":\"geese\",\n\t\t\"potato\":\"potatoes\",\n\t\t\"tomato\":\"tomatoes\",\n\t\t\"trout\":\"trout\",\n\t\t\"news\":\"news\",\n\t\t\"foot\":\"feet\",\n\t\t\"aircraft\":\"aircraft\",\n\t\t# Latin\n\t\t\"species\":\"species\", \n\t\t\"genus\":\"genera\", \n\t\t\"larva\":\"larvae\",\n\t\t\"minutia\":\"minutiae\",\n\t\t# Greek\n\t\t\"phenomenon\":\"phenomena\",\n\t\t\"schema\":\"schemata\",\n\t\t\"harmonia\":\"harmoniai\",\n\t\t\"stroma\":\"stromata\",\n\t\t# Other languages\n\t\t\"anime\":\"anime\"\n\t}\n\tif sin in exceptions.keys():\n\t\treturn exceptions[sin]\n\t# Exceptions for each rule\n\tman_exceptions = [\"human\",\"ottoman\"]\n\tsis_exceptions = [\"sis\",\"isis\",\"whatsis\"]\n\tus_exceptions = [\"genius\",\"campus\",\"virus\",\"status\",\"antivirus\"]\n\ty_exceptions = [\"by\",\"flyby\",\"standby\",\"y\"]\n\tf_exceptions = [\"roof\",\"f\",\"hoof\",\"gulf\"]\n\t# '-in-law' -\u003E 's-in-law'\n\tif sin.endswith((\"-in-law\",\" in law\")):\n\t\tin_law = sing[-7:]\n\t\tsing = sing[:-7]\n\t\tsin = sing.lower()\n\t# '-general' -\u003E 's-general'\n\tif sin.endswith((\"-general\",\" general\")):\n\t\tin_law = sing[-8:]\n\t\tsing = sing[:-8]\n\t\tsin = sing.lower()\n\t# 'itis' -\u003E 'itides'\n\tif sin.endswith(\"itis\"):\n\t\tplural = sing[:-3] + \"tides\"\n\t# '[m/l]ouse' -\u003E '[m/l]ice'\n\telif sin.endswith((\"mouse\",\"louse\")):\n\t\tplural = sing[:-4] + \"ice\"\n\t# 'man' -\u003E 'men'\n\telif sin.endswith(\"man\"):\n\t\tif sin in man_exceptions:\n\t\t\tplural = sing + \"s\"\n\t\telse:\n\t\t\tplural = sing[:-3] + \"men\"\n\t# 'sis' or 'xis' -\u003E '[s/x]es'\n\telif sin.endswith((\"sis\",\"xis\")):\n\t\tif sin in sis_exceptions:\n\t\t\tplural = sing + \"es\"\n\t\telse:\n\t\t\tplural = sing[:-2] + \"es\"\n\t# 'ix' -\u003E 'ices'\n\telif sin.endswith(\"ix\") and vowel_num \u003E 1:\n\t\tplural = sing[:-1] + \"ces\"\n\t# 'ex' -\u003E 'ices'\n\telif sin.endswith(\"ex\") and vowel_num \u003E 1:\n\t\tplural = sing[:-2] + \"ices\"\n\t# 'ium' -\u003E 'ia'\n\telif sin.endswith(\"ium\"):\n\t\tplural = sing[:-2] + \"a\"\n\t# 'rion' -\u003E 'ria'\n\telif sin.endswith(\"rion\"):\n\t\tplural = sing[:-2] + \"a\"\n\t# 'tum' or 'rum' -\u003E '[t/r]a'\n\telif sin.endswith((\"tum\",\"rum\")) and vowel_num \u003E 1:\n\t\tplural = sing[:-2] + \"a\"\n\t# 'on' -\u003E 'a'\n\telif sin.endswith(\"on\"):\n\t\tif sin[-3] in \"nx\":\n\t\t\tplural = sing[:-2] + \"a\"\n\t\telse:\n\t\t\tplural = sing + \"s\"\n\t# 'us' -\u003E 'i'\n\telif sin.endswith(\"us\") and vowel_num \u003E 1:\n\t\tif sin in us_exceptions or sin.endswith(\"ous\"):\n\t\t\tplural = sing + \"es\"\n\t\telse:\n\t\t\tplural = sing[:-2] + \"i\"\n\t# 'y' -\u003E 'ies'\n\telif sin.endswith(\"y\"):\n\t\t# '[V]y' -\u003E '[V]ys'\n\t\tif sin[-2] in vowels or sing in y_exceptions or sin.endswith(\"-by\"):\n\t\t\t# 'quy' -\u003E 'quies'\n\t\t\tif sin.endswith(\"quy\"):\n\t\t\t\tplural = sing[:-1] + \"ies\"\n\t\t\telse:\n\t\t\t\tplural = sing + 's'\n\t\telse:\n\t\t\tplural = sing[:-1] + \"ies\"\n\t# 'f' or 'fe' -\u003E 'ves'\t\n\telif sin.endswith((\"fe\",\"f\")):\n\t\tif sin in f_exceptions:\n\t\t\tplural = sing + \"s\"\n\t\telif sin[-1] == \"f\":\n\t\t\t# 'ff' -\u003E 'ffs'\n\t\t\tif sin[-2] == \"f\":\n\t\t\t\tplural = sing + \"s\"\n\t\t\telse:\n\t\t\t\tplural = sing[:-1] + \"ves\"\n\t\telse:\n\t\t\tplural = sing[:-2] + \"ves\"\n\t# add 'es'\t\n\telif sin.endswith((\"s\",\"sh\",\"z\",\"ch\",\"x\")):\n\t\tplural = sing + \"es\"\n\t# add 's'\t\n\telse:\n\t\tplural = sing + \"s\"\n\t# adds '-in-law' if necessary\n\tif in_law != *:\n\t\tplural = plural + in_law\n\t\t\n\treturn plural"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "improved English plurals, Python"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}