Z22278

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z22278"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z13254",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z600",
            "Z16K2": "function Z13254( Z13254K1, Z13254K2 ) {\n\tlet word = Z13254K1.toLowerCase();\n\tlet suffix = Z13254K2.toLowerCase();\n\t// Default result\n\tlet form = word + suffix; //+ '? (something unexpected happened)'\n\t// Return default when hyphen or apostrophe is used\n\t// TODO: remove apostrophe from test strings but keep in return\n\tif (word.endsWith(\"-\") || word.endsWith(\"’\") || word.endsWith(\"'\") ||\n\t    suffix.startsWith(\"-\") || suffix.startsWith(\"’\")) {\n\t\treturn form;\n\t}\n\t// Simple -s: adding -e- or final -y goes to -ie- \n\tif (suffix.match(/^(s|s’|s')$/)) {\n\t\tif (word.endsWith(\"y\")) {\n\t\t\tform = word.slice(0, -1) + \"ie\" + suffix;\n\t\t}\n\t\tif (/[scz]$/.test(word) || /[sc]h$/.test(word)) {\n\t\t\tform = word + \"e\" + suffix;\n\t\t}\n\t}\n\t// Adding -k- or -al- after -c\n\telse if (/[aeiou]c$/.test(word)) {\n\t\tif (/^[ei]/.test(suffix)) {\n\t\t\tif (/^i/.test(suffix) \u0026\u0026 !/^ing/.test(suffix)) {\n\t\t\t\tform = word + suffix;\n\t\t\t} else {\n\t\t\t\tform = word + \"k\" + suffix;\n\t\t\t}\n\t\t}\n\t\tif (/^l[iy]/.test(suffix) \u0026\u0026\n\t\t    word.endsWith(\"ic\") \u0026\u0026\n\t\t    !word.endsWith(\"public\") \u0026\u0026\n\t\t    !(\"chic\".includes(word))) {\n\t\t\tform = word + \"al\" + suffix;\n\t\t}\n\t}\n\t// Doubling final consonant\n\telse if (/[aeiou][bdfgklmnprstvz]$/.test(word) \u0026\u0026\n\t         !suffix.startsWith(\"ic\") \u0026\u0026\n\t         (/^[aeiou]/.test(suffix) || suffix === \"y\")) {\n\t\tif (!(/[aeiou][aeiou][bdfgklmnprstvz]$/.test(word)) \u0026\u0026\n\t\t    !(word.length \u003E 3 \u0026\u0026 word.endsWith(\"en\")) \u0026\u0026\n\t\t    !(word.endsWith(\"el\") \u0026\u0026 !word.endsWith(\"pel\")) ||\n\t\t    /qu[aeiou][bdfgkLmnprstvz]$/.test(word)) {\n\t\t\tform = word + word.slice(-1) + suffix;\n\t\t} else {\n\t\t\tform = word + suffix;\n\t\t}\n\t}\n\t// Use -i- or -y- in place of -ie\n\telse if (word.endsWith(\"ie\")) {\n\t\tif (suffix.startsWith(\"e\")) {\n\t\t\tform = word.slice(0, -1) + suffix;\n\t\t}\n\t\tif (suffix.startsWith(\"i\")) {\n\t\t\tform = word.slice(0, -2) + \"y\" + suffix;\n\t\t}\n\t}\n\t// Drop final -e before vowel suffix. Drop final -le before -ly\n\telse if (word.endsWith(\"e\") \u0026\u0026 word !== \"be\") {\n\t\tif (/^[aeiou]/.test(suffix) \u0026\u0026\n\t\t    !/[bcdfghjklmnpqrstvwxz][bdfjkmnpqrstvwxz]e$/.test(word) \u0026\u0026\n\t\t    !/[éeioy]e$/.test(word) \u0026\u0026\n\t\t    !/[cg][cg]e$/.test(word)) {\n\t\t\tif (/[cg]e$/.test(word) \u0026\u0026 !/[ei]/.test(suffix)) {\n\t\t\t\tform = word + suffix;\n\t\t\t} else {\n\t\t\t\tform = word.slice(0, -1) + suffix;\n\t\t\t}\n\t\t} else {\n\t\t\tif (/^l[iy]/.test(suffix)) {\n\t\t\t\tif (word.endsWith(\"ue\") \u0026\u0026 !/[gq]ue$/.test(word)) {\n\t\t\t\t\tform = word.slice(0, -1) + suffix;\n\t\t\t\t}\n\t\t\t\tif (word.endsWith(\"ble\")) {\n\t\t\t\t\tform = word.slice(0, -2) + suffix;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Change -y to -i- or -ie- or drop -y (or not)\n\telse if (word.endsWith(\"y\") \u0026\u0026 !/[aeio]y$/.test(word)) {\n\t\tform = word.slice(0, -1) + \"i\" + suffix; // generally -y changes to -ie-\n\t\tif (!/[aeiou]/.test(word) \u0026\u0026 !/^[ae]/.test(suffix)) {\n\t\t\tform = word + suffix; // -y may be kept as the sole vowel\n\t\t}\n\t\tif (suffix.startsWith(\"i\")) {\n\t\t\tif (!/^ing/.test(suffix)) {\n\t\t\t\tform = word.slice(0, -1) + suffix; // -y may be dropped before -i\n\t\t\t} else {\n\t\t\t\tform = word + suffix; // -y is kept before -ing\n\t\t\t}\n\t\t}\n\t\tif (suffix.match(/^(s|s'|s’)$/)) {\n\t\t\tform = word.slice(0, -1) + \"ie\" + suffix;\n\t\t}\n\t}\n\telse {\n\t\tform = word + suffix;\n\t}\n\treturn form;\n}"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "suffix English word, js"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "suffixe d'un mot en anglais, en JavaScript"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}