Z18803

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z18803"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z18790",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z610",
            "Z16K2": "def Z18790(Z18790K1):\n\timport re\n\t\n\t# Dictionary mapping Latin Kurdish vowels regex patterns to Arabic script\n\tvowel_patterns = {\n\t\t# Clean up some vowel issues first\n\t\tr' +([aeê])\\b': r'\\1', # baş e → باشە\n\t\tr' +(y[eê])\\b': r'\\1', # Şerê Cîhanî yê Duyem → شەرێ جیھانییێ دویەم\n\t\t\n\t\t# Vowels involving hamza (ئ)\n\t\t# Do not add a hamzah if it is preceded by \"ع\", as in \"'ebdulla\" or \"'ba'eba'\".\n\t\tr\"(?\u003C!['ʿ])\\b[Aa]\": \"ئا\",\n\t\tr\"(?\u003C!['ʿ])\\b[Ee]\": \"ئە\",\n\t\tr\"(?\u003C!['ʿ])\\b[Êê]\": \"ئێ\",\n\t\tr\"(?\u003C!['ʿ])\\b[Îî]\": \"ئی\",\n\t\tr\"(?\u003C!['ʿ])\\b[Oo]\": \"ئۆ\",\n\t\tr\"(?\u003C!['ʿ])\\b[Uu]\": \"ئو\",\n\t\tr\"(?\u003C!['ʿ])\\b[Ûû]\": \"ئوو\",\n\t\t\n\t\t# Vowels not involving hamza (ئ)\n\t\tr'a': 'ا',\n\t\tr'e': 'ە',\n\t\tr'ê': 'ێ',\n\t\tr'î': 'ی',\n\t\tr'i': '',  # \"Bizroke\" has no symbol in Arabic script\n\t\tr'o': 'ۆ',\n\t\tr'u': 'و',\n\t\tr'û': 'وو',\n\t}\n\t\n\t# Dictionary mapping Latin Kurdish consonants regex patterns to Arabic script\n\tconsonant_patterns = {\n\t\tr'B|b': 'ب',\n\t\tr'Ç|ç|[Cc]h': 'چ',\n\t\tr'C|c': 'ج',\n\t\tr'D|d': 'د',\n\t\tr'F|f': 'ف',\n\t\tr'Ẍ|ẍ|[Gg]h': 'غ',\n\t\tr'G|g': 'گ',\n\t\tr'Ş|ş|[Ss]h': 'ش',\n\t\tr'H|h': 'ھ',\n\t\tr'Ḧ|ḧ': 'ح',\n\t\tr'J|j': 'ژ',\n\t\tr'K|k': 'ک',\n\t\tr'[Ll]{2}': 'ڵ',\n\t\tr'L|l': 'ل',\n\t\tr'M|m': 'م',\n\t\tr'N|n': 'ن',\n\t\tr'P|p': 'پ',\n\t\tr'Q|q': 'ق',\n\t\tr'[Rr]{2}': 'ڕ',\n\t\tr'R|r': 'ر',\n\t\tr'S|s': 'س',\n\t\tr'T|t': 'ت',\n\t\tr'V|v': 'ڤ',\n\t\tr'W|w': 'و',\n\t\tr'X|x': 'خ',\n\t\tr'Y|y': 'ی',\n\t\tr'Z|z': 'ز',\n\t\tr\"'|ʿ\": 'ع', # There is no symbol for 'ع' in Latin, but we have chosen these symbols to represent it (temporary at least)\n\t}\n\t\n\t# Dictionary mapping Latin Kurdish punctuation to Arabic script equivalents\n\tpunctuation_patterns = {\n\t\tr'\\?': '؟',  # Question mark in Arabic script\n\t\tr'\\,': '،',  # Comma in Arabic script\n\t\tr'\\;': '؛',  # Semicolon in Arabic script\n\t\tr'\"(.*?)\"': r'«\\1»',  # Replace text within double quotes with angle quotes («text»)\n\t}\n\t\n\t# Dictionary mapping Latin Kurdish digits to Indo-Arabic digits\n\tdigit_patterns = {\n\t\tr'0': '٠',\n\t\tr'1': '١',\n\t\tr'2': '٢',\n\t\tr'3': '٣',\n\t\tr'4': '٤',\n\t\tr'5': '٥',\n\t\tr'6': '٦',\n\t\tr'7': '٧',\n\t\tr'8': '٨',\n\t\tr'9': '٩'\n\t}\n\t\n\t# Combine all dictionaries for replacement\n\tpatterns = {**vowel_patterns, **consonant_patterns, **punctuation_patterns, **digit_patterns}\n\t\n\t# Function to perform replacement based on regex patterns\n\tdef replace_patterns(text, patterns):\n\t\tfor pattern, replacement in patterns.items():\n\t\t\ttext = re.sub(pattern, replacement, text)\n\t\treturn text\n\t\t\n\t# Convert text from Latin Kurdish to Arabic Kurdish script\n\tarabic_script = replace_patterns(Z18790K1, patterns)\n\t\n\treturn arabic_script\n\t"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Kurdish Latin to Arabic, python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1288",
                "Z11K2": "بگۆڕی دەقی کوردیی لاتینی بۆ عەرەبی بە پایتن"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1014",
                "Z11K2": "Latịn Kurdish ruo Arabic, Python"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31",
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1002",
                "Z31K2": [
                    "Z6",
                    "Kurdish Latin2Arabic"
                ]
            },
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1288",
                "Z31K2": [
                    "Z6",
                    "کوردیی لاتینی بۆ عەرەبی"
                ]
            }
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Converts Kurdish Latin to Arabic script."
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1288",
                "Z11K2": "پیتە کوردییە لاتینییەکان دەکاتە عەرەبی."
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1014",
                "Z11K2": "Na-atụgharị Latịn Kurdish ka ọ bụrụ mkpụrụedemede Arabik."
            }
        ]
    }
}