Z13256

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z13256"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z13254",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z610",
            "Z16K2": "def Z13254(Z13254K1, Z13254K2):\n\timport re\n\tword = Z13254K1.lower()\n\tsuffix = Z13254K2.lower()\n# Default result\n\tform = word + suffix #+ '? (something unexpected happened)'\n# Return default when hyphen or apostrophe is used\n# TODO: remove apostrophe from test strings but keep in return\n\tif word.endswith(('-', '’', \"'\")) \\\n\tor suffix.startswith(('-','’')):\n\t\treturn form\n# Simple -s: adding -e- or final -y goes to -ie-\n\tif suffix in ('s', \"s’\", \"s'\"):\n\t\tif word.endswith('y'):\n\t\t\tform = word[:-1] + 'ie' + suffix\n\t\tif re.search(r'[scz]$', word) \\\n\t\t\t\tor re.search(r'[sc]h$', word):\n\t\t\tform = word + 'e' + suffix\n# Adding -k- or -al- after -c\n\telif re.search(r'[aeiou]c$', word):\n\t\tif re.search(r'^[ei]', suffix):\n\t\t\tif re.search(r'^i', suffix) \\\n\t\t\t\t\tand not re.search(r'^ing', suffix):\n\t\t\t\tform = word + suffix\n\t\t\telse:\n\t\t\t\tform = word + 'k' + suffix\n\t\tif re.search(r'^l[iy]', suffix) \\\n\t\t\t\tand word.endswith('ic') \\\n\t\t\t\tand not word.endswith('public') \\\n\t\t\t\tand not word in ('chic'):\n\t\t\tform = word + 'al' + suffix\n# Doubling final consonant\n\telif re.search(r'[aeiou][bdfgklmnprstvz]$', word) \\\n\t\t\tand not suffix.startswith('ic') \\\n\t\t\tand (re.search(r'^[aeiou]', suffix) \\\n\t\t\t\t\tor suffix == 'y'):\n\t\tif not re.search(r'[aeiou][aeiou][bdfgklmnprstvz]$', word) \\\n\t\t\t\tand not ((len(word) \u003E3 and word.endswith('en'))) \\\n\t\t\t\tand not ((word.endswith('el') and not word.endswith('pel')) )\\\n\t\t\t\tor re.search(r'qu[aeiou][bdfgkLmnprstvz]$', word):\n\t\t\tform = word + word[-1] + suffix\n\t\telse:\n\t\t\tform = word + suffix\n# Use -i- or -y- in place of -ie\n\telif word.endswith('ie'):\n\t\tif suffix.startswith('e'):\n\t\t\tform = word[:-1] + suffix\n\t\tif suffix.startswith('i'):\n\t\t\tform = word[:-2] + 'y' + suffix\n# Drop final -e before vowel suffix. Drop final -le before -ly\n\telif word.endswith('e') and not word == 'be':\n\t\tif re.search(r'^[aeiou]', suffix) \\\n\t\t\t\tand not re.search(r'[bcdfghjklmnpqrstvwxz][bdfjkmnpqrstvwxz]e$', word) \\\n\t\t\t\tand not re.search(r'[éeioy]e$', word) \\\n\t\t\t\tand not re.search(r'[cg][cg]e$', word):\n\t\t\tif re.search(r'[cg]e$', word) \\\n\t\t\t\t\tand not re.search(r'[ei]', suffix):\n\t\t\t\tform = word + suffix\n\t\t\telse:\n\t\t\t\tform = word[:-1] + suffix\n\t\telse:\n\t\t\tif re.search(r'^l[iy]', suffix):\n\t\t\t\tif word.endswith('ue') \\\n\t\t\t\t\t\tand not re.search(r'[gq]ue$', word):\n\t\t\t\t\tform = word[:-1] + suffix\n\t\t\t\tif word.endswith('ble'):\n\t\t\t\t\tform = word[:-2] + suffix\n# Change -y to -i- or -ie- or drop -y (or not)\n\telif word.endswith('y') \\\n\t\t\tand not re.search(r'[aeio]y$', word):\n\t\tform = word[:-1] + 'i' + suffix # generally -y changes to -ie-\n\t\tif not re.search(r'[aeiou]', word) \\\n\t\t\t\tand not re.search(r'^[ae]', suffix):\n\t\t\tform = word + suffix # -y may be kept as the sole vowel\n\t\tif suffix.startswith('i'):\n\t\t\tif not re.search(r'^ing', suffix):\n\t\t\t\tform = word[:-1] + suffix # -y may be dropped before -i\n\t\t\telse:\n\t\t\t\tform = word + suffix # -y is kept before -ing\n\t\tif suffix in ('s', \"s'\", \"s’\"):\n\t\t\tform = word[:-1] + 'ie' + suffix\n\telse:\n\t\tform = word + suffix\n\treturn form"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Suffix English word in Python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1014",
                "Z11K2": " mgbakwunye okwu bekee na Python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1830",
                "Z11K2": "Pythonで英単語に接尾辞をつける"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1430",
                "Z11K2": "Suffix für englisches Wort in Python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "suffixe d'un mot en anglais, en Python"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Append a suffix to an English word with regular spelling adjustments"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1014",
                "Z11K2": "Tinye mgbakwunye na okwu bekee nwere mmezi mkpoputa oge niile"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1430",
                "Z11K2": "Python-Implementierung der Funktion zum Anhängen eines Suffix an ein englisches Wort"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "ajoute un suffixe à un mot anglais avec des ajustements orthographiques réguliers"
            }
        ]
    }
}