1576 lines
54 KiB
Python
Executable File
1576 lines
54 KiB
Python
Executable File
# # import requests
|
|
# # from requests.exceptions import SSLError
|
|
# from google.cloud import translate_v2 as Translate
|
|
# import os
|
|
#
|
|
#
|
|
# # google api creds and setup
|
|
# os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "authentication.json"
|
|
# translate_client = Translate.Client()
|
|
#
|
|
#
|
|
#
|
|
# h = 0
|
|
# def google(text, source_lang, target_lang):
|
|
#
|
|
# try:
|
|
# if h < 3:
|
|
# print("hello")
|
|
# result = translate_client.translate(
|
|
# text, source_language=source_lang, target_language=target_lang)
|
|
# return result['translatedText']
|
|
# except:
|
|
# google(text, source_lang, target_lang)
|
|
# # except:
|
|
# # print("The text unable to translate is", text)
|
|
# # return text
|
|
#
|
|
# google("my name is dharmesh", "en", "hi")
|
|
|
|
# f = open("C:\\Users\\ANSU\\Desktop\\MNF\\Conversion\\file_lines.txt", "r")
|
|
# cleaned_lines_data = f.readlines()
|
|
# # print(len(cleaned_lines_data))
|
|
# last_line_not_upper = 55
|
|
# for idx in range(55, 46, -1):
|
|
# print(str(cleaned_lines_data[idx]))
|
|
# print("case1", str(cleaned_lines_data[idx]).strip() == "")
|
|
# print("case2", str(cleaned_lines_data[idx]).isupper())
|
|
# print("case3", len(cleaned_lines_data[idx]) > 0)
|
|
# if str(cleaned_lines_data[idx]).strip() == "" or (str(cleaned_lines_data[idx]).isupper() and len(cleaned_lines_data[idx]) > 0):
|
|
# print("case1", str(cleaned_lines_data[idx]).strip() == "")
|
|
# print("case2", str(cleaned_lines_data[idx]).isupper())
|
|
# print("case3", len(cleaned_lines_data[idx]) > 0)
|
|
# pass
|
|
# else:
|
|
# last_line_not_upper = idx
|
|
# break
|
|
# print("last_line_not_upper", last_line_not_upper)
|
|
# for idx in range(56, 50, -1):/
|
|
# from collections import Counter
|
|
# a = ["bg", "en", "en"]
|
|
# c = Counter(a).most_common(1)[0][0]
|
|
# print(c)
|
|
#
|
|
#
|
|
# el
|
|
# ko
|
|
# te
|
|
# kk
|
|
# ru
|
|
# es
|
|
# ta
|
|
# Latin
|
|
# de
|
|
# id
|
|
# ja
|
|
# km
|
|
# kn
|
|
# Telugu
|
|
# or
|
|
# en
|
|
# en
|
|
# kk
|
|
# tamil
|
|
# Latin
|
|
# ja
|
|
# th
|
|
# kn
|
|
# mr
|
|
# pa
|
|
# hy
|
|
# ur
|
|
# fr
|
|
# af
|
|
# hi
|
|
# en
|
|
# hi
|
|
# hi
|
|
# ar
|
|
# en
|
|
# es
|
|
# fr
|
|
# ne
|
|
# ml
|
|
# bn
|
|
# bg
|
|
# it
|
|
# mr
|
|
# hy
|
|
# fr
|
|
# lo
|
|
# af
|
|
# en
|
|
# hi
|
|
# fr
|
|
# es
|
|
# ml
|
|
# bg
|
|
# km
|
|
# en
|
|
# zn-CH
|
|
# lo
|
|
# fa
|
|
# en
|
|
# hi
|
|
# hi
|
|
# hi
|
|
# hi
|
|
# hi
|
|
# hi
|
|
# en
|
|
# hi
|
|
# codes = [
|
|
# # 'af', 'sq', 'ar', 'as', 'ay', 'az', 'bm', 'eu', 'be', 'bn', 'bho', 'bs', 'bg', 'ca', 'ceb', 'ny', 'zh-CN', 'zh-TW', 'co', 'hr', 'cs', 'da', 'doi', 'nl', 'en', 'eo', 'et', 'ee', 'tl', 'fi', 'fr', 'fy', 'gl', 'lg', 'ka', 'de', 'gn', 'gu', 'ht', 'ha', 'he', 'hi', 'hmn', 'hu', 'is', 'ig', 'ilo', 'id', 'ga', 'it', 'ja', 'jv', 'kn', 'kk', 'km', 'rw', 'gom', 'ko', 'kri', 'ku', 'ckb', 'ky', 'lo', 'la', 'lv', 'ln', 'lt', 'lb', 'mk', 'mai', 'mg', 'ms', 'ml', 'mt', 'mi', 'mr', 'lus', 'mn', 'ne', 'nso', 'no', 'or', 'om', 'ps', 'fa', 'pl', 'pt', 'pa', 'qu', 'ro', 'ru', 'sm', 'sa', 'sr', 'st', 'sn', 'sd', 'si', 'sk', 'sl', 'so', 'es', 'su', 'sw', 'sv', 'tg', 'ta', 'tt', 'te', 'th', 'ts', 'tr', 'tk', 'ak', 'uk', 'ur', 'ug', 'uz', 'vi', 'cy', 'xh', 'yi', 'yo', 'zu']
|
|
# # language_codes = [
|
|
# # 'el', 'ko', 'te', 'kk', 'ru', 'es', 'ta', 'hi', 'de', 'id', 'ja', 'km', 'kn', 'te', 'or', 'en', 'ar', 'kk',
|
|
# # 'ta', 'hi', 'ja', 'th', 'kn', 'mr', 'pa', 'hy', 'ur', 'fr', 'af', 'hi', 'en', 'hi', 'hi', 'ar', 'ar', 'es', 'fr',
|
|
# # 'ne', 'ml', 'bn', 'bg', 'it', 'mr', 'hy', 'fr', 'lo', 'af', 'en', 'hi', 'fr', 'es', 'ml', 'bg', 'km', 'en', 'zn-CH',
|
|
# # 'lo', 'fa', 'en', 'en', 'en', 'en', 'en', 'en', 'en', 'en', 'en'
|
|
# # ]
|
|
# #
|
|
# # langss1 = list(set(language_codes))
|
|
# # print(langss1)
|
|
# # odd_langs = [lang for lang in langss1 if lang not in codes]
|
|
# # print(odd_langs)
|
|
|
|
|
|
transliteration_dict = {
|
|
"ar": {
|
|
"name": "Arabic",
|
|
"nativeName": "العربية",
|
|
"scripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "العربية",
|
|
"dir": "rtl",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "اللاتينية",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "اللاتينية",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "العربية",
|
|
"dir": "rtl"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"as": {
|
|
"name": "Assamese",
|
|
"nativeName": "অসমীয়া",
|
|
"scripts": [
|
|
{
|
|
"code": "Beng",
|
|
"name": "Bengali",
|
|
"nativeName": "বাংলা",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "লেটিন",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "লেটিন",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Beng",
|
|
"name": "Bangla",
|
|
"nativeName": "বাংলা",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"be": {
|
|
"name": "Belarusian",
|
|
"nativeName": "беларуская",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "Кірыліца",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Лацініца",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Лацініца",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "Кірыліца",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"bg": {
|
|
"name": "Bulgarian",
|
|
"nativeName": "Български",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилица",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латиница",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латиница",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилица",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"bn": {
|
|
"name": "Bangla",
|
|
"nativeName": "বাংলা",
|
|
"scripts": [
|
|
{
|
|
"code": "Beng",
|
|
"name": "Bengali",
|
|
"nativeName": "বাংলা",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ল্যাটিন",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ল্যাটিন",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Beng",
|
|
"name": "Bangla",
|
|
"nativeName": "বাংলা",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"brx": {
|
|
"name": "Bodo",
|
|
"nativeName": "बड़ो",
|
|
"scripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "Devanagari",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "Devanagari",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"el": {
|
|
"name": "Greek",
|
|
"nativeName": "Ελληνικά",
|
|
"scripts": [
|
|
{
|
|
"code": "Grek",
|
|
"name": "Greek",
|
|
"nativeName": "ελληνικό",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "λατινικό",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "λατινικό",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Grek",
|
|
"name": "Greek",
|
|
"nativeName": "ελληνικό",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"fa": {
|
|
"name": "Persian",
|
|
"nativeName": "فارسی",
|
|
"scripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "عربی",
|
|
"dir": "rtl",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "لاتین",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "لاتین",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "عربی",
|
|
"dir": "rtl"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"gom": {
|
|
"name": "Konkani",
|
|
"nativeName": "Konkani",
|
|
"scripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "Devanagari",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "Devanagari",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"gu": {
|
|
"name": "Gujarati",
|
|
"nativeName": "ગુજરાતી",
|
|
"scripts": [
|
|
{
|
|
"code": "Gujr",
|
|
"name": "Gujarati",
|
|
"nativeName": "ગુજરાતી",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "લેટિન",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "લેટિન",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Gujr",
|
|
"name": "Gujarati",
|
|
"nativeName": "ગુજરાતી",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"he": {
|
|
"name": "Hebrew",
|
|
"nativeName": "עברית",
|
|
"scripts": [
|
|
{
|
|
"code": "Hebr",
|
|
"name": "Hebrew",
|
|
"nativeName": "עברי",
|
|
"dir": "rtl",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "לטיני",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "לטיני",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Hebr",
|
|
"name": "Hebrew",
|
|
"nativeName": "עברי",
|
|
"dir": "rtl"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"hi": {
|
|
"name": "Hindi",
|
|
"nativeName": "हिन्दी",
|
|
"scripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "देवनागरी",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "लैटिन",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "लैटिन",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "देवनागरी",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ja": {
|
|
"name": "Japanese",
|
|
"nativeName": "日本語",
|
|
"scripts": [
|
|
{
|
|
"code": "Jpan",
|
|
"name": "Japanese",
|
|
"nativeName": "日本語の文字",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ラテン文字",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ラテン文字",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Jpan",
|
|
"name": "Japanese",
|
|
"nativeName": "日本語の文字",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"kk": {
|
|
"name": "Kazakh",
|
|
"nativeName": "Қазақ Тілі",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилл жазуы",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латын жазуы",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латын жазуы",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилл жазуы",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"kn": {
|
|
"name": "Kannada",
|
|
"nativeName": "ಕನ್ನಡ",
|
|
"scripts": [
|
|
{
|
|
"code": "Knda",
|
|
"name": "Kannada",
|
|
"nativeName": "ಕನ್ನಡ",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ಲ್ಯಾಟಿನ್",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ಲ್ಯಾಟಿನ್",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Knda",
|
|
"name": "Kannada",
|
|
"nativeName": "ಕನ್ನಡ",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ko": {
|
|
"name": "Korean",
|
|
"nativeName": "한국어",
|
|
"scripts": [
|
|
{
|
|
"code": "Kore",
|
|
"name": "Korean",
|
|
"nativeName": "한국 문자",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "로마자",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "로마자",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Kore",
|
|
"name": "Korean",
|
|
"nativeName": "한국 문자",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ks": {
|
|
"name": "Kashmiri",
|
|
"nativeName": "کٲشُر",
|
|
"scripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "Arabic",
|
|
"dir": "rtl",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "Arabic",
|
|
"dir": "rtl"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ky": {
|
|
"name": "Kyrgyz",
|
|
"nativeName": "Кыргызча",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилл",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латын",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латын",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилл",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"mai": {
|
|
"name": "Maithili",
|
|
"nativeName": "Maithili",
|
|
"scripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "Devanagari",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "Devanagari",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"mk": {
|
|
"name": "Macedonian",
|
|
"nativeName": "Македонски",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилско писмо",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латинично писмо",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латинично писмо",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилско писмо",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ml": {
|
|
"name": "Malayalam",
|
|
"nativeName": "മലയാളം",
|
|
"scripts": [
|
|
{
|
|
"code": "Mlym",
|
|
"name": "Malayalam",
|
|
"nativeName": "മലയാളം",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ലാറ്റിൻ",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ലാറ്റിൻ",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Mlym",
|
|
"name": "Malayalam",
|
|
"nativeName": "മലയാളം",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"mn-Cyrl": {
|
|
"name": "Mongolian (Cyrillic)",
|
|
"nativeName": "Mongolian (Cyrillic)",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилл",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латин",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латин",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилл",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"mni": {
|
|
"name": "Manipuri",
|
|
"nativeName": "মৈতৈলোন্",
|
|
"scripts": [
|
|
{
|
|
"code": "Beng",
|
|
"name": "Bengali",
|
|
"nativeName": "Bengali",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Beng",
|
|
"name": "Bangla",
|
|
"nativeName": "Bengali",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"mr": {
|
|
"name": "Marathi",
|
|
"nativeName": "मराठी",
|
|
"scripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "देवनागरी",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "लॅटिन",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "लॅटिन",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "देवनागरी",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ne": {
|
|
"name": "Nepali",
|
|
"nativeName": "नेपाली",
|
|
"scripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "देवानागरी",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ल्याटिन",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ल्याटिन",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "देवानागरी",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"or": {
|
|
"name": "Odia",
|
|
"nativeName": "ଓଡ଼ିଆ",
|
|
"scripts": [
|
|
{
|
|
"code": "Orya",
|
|
"name": "Odia",
|
|
"nativeName": "ଓଡ଼ିଆ",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ଲାଟିନ୍",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ଲାଟିନ୍",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Orya",
|
|
"name": "Odia",
|
|
"nativeName": "ଓଡ଼ିଆ",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"pa": {
|
|
"name": "Punjabi",
|
|
"nativeName": "ਪੰਜਾਬੀ",
|
|
"scripts": [
|
|
{
|
|
"code": "Guru",
|
|
"name": "Gurmukhi",
|
|
"nativeName": "ਗੁਰਮੁਖੀ",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ਲਾਤੀਨੀ",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ਲਾਤੀਨੀ",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Guru",
|
|
"name": "Gurmukhi",
|
|
"nativeName": "ਗੁਰਮੁਖੀ",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ru": {
|
|
"name": "Russian",
|
|
"nativeName": "Русский",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кириллица",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латиница",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латиница",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кириллица",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"sa": {
|
|
"name": "Sanskrit",
|
|
"nativeName": "संस्कृत",
|
|
"scripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "Devanagari",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Latin",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Deva",
|
|
"name": "Devanagari",
|
|
"nativeName": "Devanagari",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"sd": {
|
|
"name": "Sindhi",
|
|
"nativeName": "سنڌي",
|
|
"scripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "عربي",
|
|
"dir": "rtl",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "لاطيني",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "لاطيني",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "عربي",
|
|
"dir": "rtl"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"si": {
|
|
"name": "Sinhala",
|
|
"nativeName": "සිංහල",
|
|
"scripts": [
|
|
{
|
|
"code": "Sinh",
|
|
"name": "Sinhala",
|
|
"nativeName": "සිංහල",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ලතින්",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ලතින්",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Sinh",
|
|
"name": "Sinhala",
|
|
"nativeName": "සිංහල",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"sr-Cyrl": {
|
|
"name": "Serbian (Cyrillic)",
|
|
"nativeName": "Српски (ћирилица)",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "ћирилица",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "latinica",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"sr-Latn": {
|
|
"name": "Serbian (Latin)",
|
|
"nativeName": "Srpski (latinica)",
|
|
"scripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "latinica",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "ćirilica",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ta": {
|
|
"name": "Tamil",
|
|
"nativeName": "தமிழ்",
|
|
"scripts": [
|
|
{
|
|
"code": "Taml",
|
|
"name": "Tamil",
|
|
"nativeName": "தமிழ்",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "லத்தின்",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "லத்தின்",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Taml",
|
|
"name": "Tamil",
|
|
"nativeName": "தமிழ்",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"te": {
|
|
"name": "Telugu",
|
|
"nativeName": "తెలుగు",
|
|
"scripts": [
|
|
{
|
|
"code": "Telu",
|
|
"name": "Telugu",
|
|
"nativeName": "తెలుగు",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "లాటిన్",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "లాటిన్",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Telu",
|
|
"name": "Telugu",
|
|
"nativeName": "తెలుగు",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"tg": {
|
|
"name": "Tajik",
|
|
"nativeName": "Tajik (Cyrillic)",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "Кириллӣ",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Лотинӣ",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "Лотинӣ",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "Кириллӣ",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"th": {
|
|
"name": "Thai",
|
|
"nativeName": "ไทย",
|
|
"scripts": [
|
|
{
|
|
"code": "Thai",
|
|
"name": "Thai",
|
|
"nativeName": "ไทย",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "ละติน",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"tt": {
|
|
"name": "Tatar",
|
|
"nativeName": "Татар",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилл",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латин",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латин",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилл",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"uk": {
|
|
"name": "Ukrainian",
|
|
"nativeName": "Українська",
|
|
"scripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилиця",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латиниця",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "латиниця",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Cyrl",
|
|
"name": "Cyrillic",
|
|
"nativeName": "кирилиця",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ur": {
|
|
"name": "Urdu",
|
|
"nativeName": "اردو",
|
|
"scripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "عربی",
|
|
"dir": "rtl",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "لاطینی",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "لاطینی",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Arab",
|
|
"name": "Arabic",
|
|
"nativeName": "عربی",
|
|
"dir": "rtl"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"zh-Hans": {
|
|
"name": "Chinese Simplified",
|
|
"nativeName": "中文 (简体)",
|
|
"scripts": [
|
|
{
|
|
"code": "Hans",
|
|
"name": "Simplified",
|
|
"nativeName": "简体汉语",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "拉丁语",
|
|
"dir": "ltr"
|
|
},
|
|
{
|
|
"code": "Hant",
|
|
"name": "Hat",
|
|
"nativeName": "传统",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "拉丁语",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Hans",
|
|
"name": "Han",
|
|
"nativeName": "简体汉语",
|
|
"dir": "ltr"
|
|
},
|
|
{
|
|
"code": "Hant",
|
|
"name": "Hat",
|
|
"nativeName": "传统",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"zh-Hant": {
|
|
"name": "Chinese Traditional",
|
|
"nativeName": "繁體中文 (繁體)",
|
|
"scripts": [
|
|
{
|
|
"code": "Hant",
|
|
"name": "Traditional",
|
|
"nativeName": "傳統",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "拉丁语",
|
|
"dir": "ltr"
|
|
},
|
|
{
|
|
"code": "Hans",
|
|
"name": "Han",
|
|
"nativeName": "简体汉语",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"code": "Latn",
|
|
"name": "Latin",
|
|
"nativeName": "拉丁文",
|
|
"dir": "ltr",
|
|
"toScripts": [
|
|
{
|
|
"code": "Hans",
|
|
"name": "Han",
|
|
"nativeName": "简体汉语",
|
|
"dir": "ltr"
|
|
},
|
|
{
|
|
"code": "Hant",
|
|
"name": "Hat",
|
|
"nativeName": "传统",
|
|
"dir": "ltr"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
|
|
# import json
|
|
# transliteration_pairs = json.load(open("response99"))
|
|
# print(transliteration_pairs)
|
|
import uuid
|
|
print(str(uuid.uuid4()))
|
|
|
|
script_pairs = []
|
|
keys = transliteration_dict.keys()
|
|
# print(keys)
|
|
for key in keys:
|
|
# print(transliteration_dict[str(key)]['scripts'])
|
|
for script_pair in transliteration_dict[str(key)]['scripts']:
|
|
# print(script_pair['name'])
|
|
for toscript in script_pair['toScripts']:
|
|
# print(f"{script_pair['name']} - {toscript['name']}")
|
|
# print(toscript['name'])
|
|
# print(script_pair['toScripts'][0]["name"])
|
|
script_pairs.append(f"{script_pair['name']} - {toscript['name']}")
|
|
['Arabic - Latin', 'Latin - Arabic', 'Bengali - Latin', 'Latin - Bangla', 'Cyrillic - Latin', 'Latin - Cyrillic'
|
|
,
|
|
'Cyrillic - Latin', 'Latin - Cyrillic', 'Bengali - Latin', 'Latin - Bangla', 'Devanagari - Latin',
|
|
'Latin - Devanagari', 'Greek - Latin', 'Latin - Greek', 'Arabic - Latin', 'Latin - Arabic', 'Devanagari - Latin',
|
|
'Latin - Devanagari', 'Gujarati - Latin', 'Latin - Gujarati', 'Hebrew - Latin', 'Latin - Hebrew', 'Devanagari - Latin',
|
|
'Latin - Devanagari', 'Japanese - Latin', 'Latin - Japanese', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Kannada - Latin', 'Latin - Kannada', 'Korean - Latin', 'Latin - Korean', 'Arabic - Latin', 'Latin - Arabic', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Devanagari - Latin', 'Latin - Devanagari', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Malayalam - Latin', 'Latin - Malayalam', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Bengali - Latin', 'Latin - Bangla', 'Devanagari - Latin', 'Latin - Devanagari', 'Devanagari - Latin', 'Latin - Devanagari', 'Odia - Latin', 'Latin - Odia', 'Gurmukhi - Latin', 'Latin - Gurmukhi', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Devanagari - Latin', 'Latin - Devanagari', 'Arabic - Latin', 'Latin - Arabic', 'Sinhala - Latin', 'Latin - Sinhala', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Tamil - Latin', 'Latin - Tamil', 'Telugu - Latin', 'Latin - Telugu', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Thai - Latin', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Cyrillic - Latin', 'Latin - Cyrillic', 'Arabic - Latin', 'Latin - Arabic', 'Simplified - Latin', 'Simplified - Hat', 'Latin - Han', 'Latin - Hat', 'Traditional - Latin', 'Traditional - Han', 'Latin - Han', 'Latin - Hat']
|
|
|
|
print(script_pairs) |