From d411600f35cb8e8e159fe60b74790816d422a506 Mon Sep 17 00:00:00 2001 From: MikeyMCZ Date: Wed, 1 Mar 2023 16:00:50 -0800 Subject: [PATCH 01/27] Adding translator API definition (#1) * Adding translator API definition * Fixing PR comments, part 1 * Fixes and python * Add versions * fix PR comments * fix operation definition * Enable all operations and dotnet * Fixes for languages API * Double clients and new auth method * PR comment fix * Switch to custom operations * Removing the APIM client * Adding emitters * Update api-version * Updates to models * Attempt to fix the api-version * Fixing API version * Fix dictionaries. * Fix the models * Models fixes * Removing detect, fix breaksentence * Adding examples * Fixing languages endpoint * Updating generation --------- Co-authored-by: Michal Materna Co-authored-by: Catalina Peralta --- .../translator/cadl-project.yaml | 26 + .../examples/3.0/BreakSentence.json | 39 + .../examples/3.0/DictionaryExamples.json | 52 + .../examples/3.0/DictionaryLookup.json | 61 + .../translator/examples/3.0/GetLanguages.json | 2733 +++++++++++++++++ .../translator/examples/3.0/Translate.json | 41 + .../examples/3.0/Transliterate.json | 35 + .../cognitiveservices/translator/main.cadl | 49 + .../cognitiveservices/translator/package.json | 20 + .../models-breaksentence.cadl | 54 + .../text-translation/models-dictionary.cadl | 232 ++ .../text-translation/models-languages.cadl | 139 + .../text-translation/models-shared.cadl | 48 + .../text-translation/models-translate.cadl | 264 ++ .../models-transliterate.cadl | 58 + .../translator/text-translation/routes.cadl | 54 + 16 files changed, 3905 insertions(+) create mode 100644 specification/cognitiveservices/translator/cadl-project.yaml create mode 100644 specification/cognitiveservices/translator/examples/3.0/BreakSentence.json create mode 100644 specification/cognitiveservices/translator/examples/3.0/DictionaryExamples.json create mode 100644 specification/cognitiveservices/translator/examples/3.0/DictionaryLookup.json create mode 100644 specification/cognitiveservices/translator/examples/3.0/GetLanguages.json create mode 100644 specification/cognitiveservices/translator/examples/3.0/Translate.json create mode 100644 specification/cognitiveservices/translator/examples/3.0/Transliterate.json create mode 100644 specification/cognitiveservices/translator/main.cadl create mode 100644 specification/cognitiveservices/translator/package.json create mode 100644 specification/cognitiveservices/translator/text-translation/models-breaksentence.cadl create mode 100644 specification/cognitiveservices/translator/text-translation/models-dictionary.cadl create mode 100644 specification/cognitiveservices/translator/text-translation/models-languages.cadl create mode 100644 specification/cognitiveservices/translator/text-translation/models-shared.cadl create mode 100644 specification/cognitiveservices/translator/text-translation/models-translate.cadl create mode 100644 specification/cognitiveservices/translator/text-translation/models-transliterate.cadl create mode 100644 specification/cognitiveservices/translator/text-translation/routes.cadl diff --git a/specification/cognitiveservices/translator/cadl-project.yaml b/specification/cognitiveservices/translator/cadl-project.yaml new file mode 100644 index 000000000000..8a532bf9879b --- /dev/null +++ b/specification/cognitiveservices/translator/cadl-project.yaml @@ -0,0 +1,26 @@ +emit: [ + "@azure-tools/cadl-csharp", + "@azure-tools/cadl-python", + "@azure-tools/cadl-java", + "@azure-tools/cadl-typescript" +] +options: + "@azure-tools/cadl-csharp": + clear-output-folder: true + namespace: Azure.AI.TextTranslator + model-namespace: true + "@azure-tools/cadl-python": + "basic-setup-py": true + "package-version": 1.0.0b1 + "package-name": azure-ai-translation-text + "@azure-tools/cadl-java": + "emitter-output-dir": "cadl-output/@azure-tools/cadl-java" + namespace: com.azure.ai.texttranslator + "@azure-tools/cadl-typescript": + "emitter-output-dir": "cadl-output/@azure-tools/cadl-typescript" + generateMetadata: true + generateTest: true + azureSdkForJs: true + packageDetails: + name: "@azure-rest/cognitiveservices-translator" + description: "Microsoft Translator Service" diff --git a/specification/cognitiveservices/translator/examples/3.0/BreakSentence.json b/specification/cognitiveservices/translator/examples/3.0/BreakSentence.json new file mode 100644 index 000000000000..e6a1eff5b8e1 --- /dev/null +++ b/specification/cognitiveservices/translator/examples/3.0/BreakSentence.json @@ -0,0 +1,39 @@ +{ + "operationId": "Translator_TextTranslation_BreakSentence", + "title": "Returns an array of integers representing the length of sentences in a source text.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "body": [ + {"Text":"How are you? I am fine. What did you do today?"} + ] + }, + "responses": { + "200": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/cognitiveservices/translator/examples/3.0/DictionaryExamples.json b/specification/cognitiveservices/translator/examples/3.0/DictionaryExamples.json new file mode 100644 index 000000000000..84c3136dedf3 --- /dev/null +++ b/specification/cognitiveservices/translator/examples/3.0/DictionaryExamples.json @@ -0,0 +1,52 @@ +{ + "operationId": "Translator_TextTranslation_DictionaryExamples", + "title": "Returns alternatives for single word translations.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "From": "en", + "To": "es", + "body": [ + {"Text":"fly", "Translation":"volar"} + ] + }, + "responses": { + "200": [ + { + "normalizedSource":"fly", + "normalizedTarget":"volar", + "examples":[ + { + "sourcePrefix":"They need machines to ", + "sourceTerm":"fly", + "sourceSuffix":".", + "targetPrefix":"Necesitan máquinas para ", + "targetTerm":"volar", + "targetSuffix":"." + }, + { + "sourcePrefix":"That should really ", + "sourceTerm":"fly", + "sourceSuffix":".", + "targetPrefix":"Eso realmente debe ", + "targetTerm":"volar", + "targetSuffix":"." + } + ] + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/cognitiveservices/translator/examples/3.0/DictionaryLookup.json b/specification/cognitiveservices/translator/examples/3.0/DictionaryLookup.json new file mode 100644 index 000000000000..0763efe7924e --- /dev/null +++ b/specification/cognitiveservices/translator/examples/3.0/DictionaryLookup.json @@ -0,0 +1,61 @@ +{ + "operationId": "Translator_TextTranslation_DictionaryLookup", + "title": "Returns alternatives for single word translations.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "From": "en", + "To": "es", + "body": [ + {"Text":"fly"} + ] + }, + "responses": { + "200": [ + { + "normalizedSource":"fly", + "displaySource":"fly", + "translations":[ + { + "normalizedTarget":"volar", + "displayTarget":"volar", + "posTag":"VERB", + "confidence":0.4081, + "prefixWord":"", + "backTranslations":[ + {"normalizedText":"fly","displayText":"fly","numExamples":15,"frequencyCount":4637}, + {"normalizedText":"flying","displayText":"flying","numExamples":15,"frequencyCount":1365}, + {"normalizedText":"blow","displayText":"blow","numExamples":15,"frequencyCount":503}, + {"normalizedText":"flight","displayText":"flight","numExamples":15,"frequencyCount":135} + ] + }, + { + "normalizedTarget":"mosca", + "displayTarget":"mosca", + "posTag":"NOUN", + "confidence":0.2668, + "prefixWord":"", + "backTranslations":[ + {"normalizedText":"fly","displayText":"fly","numExamples":15,"frequencyCount":1697}, + {"normalizedText":"flyweight","displayText":"flyweight","numExamples":0,"frequencyCount":48}, + {"normalizedText":"flies","displayText":"flies","numExamples":9,"frequencyCount":34} + ] + } + ] + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/cognitiveservices/translator/examples/3.0/GetLanguages.json b/specification/cognitiveservices/translator/examples/3.0/GetLanguages.json new file mode 100644 index 000000000000..dd117ee55b0d --- /dev/null +++ b/specification/cognitiveservices/translator/examples/3.0/GetLanguages.json @@ -0,0 +1,2733 @@ +{ + "operationId": "Translator_TextTranslation_GetLanguages", + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "body": {} + }, + "responses": { + "200": { + "body": { + "translation": { + "af": { + "name": "Afrikaans", + "nativeName": "Afrikaans", + "dir": "ltr" + }, + "am": { + "name": "Amharic", + "nativeName": "አማርኛ", + "dir": "ltr" + }, + "ar": { + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl" + }, + "as": { + "name": "Assamese", + "nativeName": "অসমীয়া", + "dir": "ltr" + }, + "az": { + "name": "Azerbaijani", + "nativeName": "Azərbaycan", + "dir": "ltr" + }, + "ba": { + "name": "Bashkir", + "nativeName": "Bashkir", + "dir": "ltr" + }, + "bg": { + "name": "Bulgarian", + "nativeName": "Български", + "dir": "ltr" + }, + "bn": { + "name": "Bangla", + "nativeName": "বাংলা", + "dir": "ltr" + }, + "bo": { + "name": "Tibetan", + "nativeName": "བོད་སྐད་", + "dir": "ltr" + }, + "bs": { + "name": "Bosnian", + "nativeName": "Bosnian", + "dir": "ltr" + }, + "ca": { + "name": "Catalan", + "nativeName": "Català", + "dir": "ltr" + }, + "cs": { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr" + }, + "cy": { + "name": "Welsh", + "nativeName": "Cymraeg", + "dir": "ltr" + }, + "da": { + "name": "Danish", + "nativeName": "Dansk", + "dir": "ltr" + }, + "de": { + "name": "German", + "nativeName": "Deutsch", + "dir": "ltr" + }, + "dv": { + "name": "Divehi", + "nativeName": "ދިވެހިބަސް", + "dir": "rtl" + }, + "el": { + "name": "Greek", + "nativeName": "Ελληνικά", + "dir": "ltr" + }, + "en": { + "name": "English", + "nativeName": "English", + "dir": "ltr" + }, + "es": { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr" + }, + "et": { + "name": "Estonian", + "nativeName": "Eesti", + "dir": "ltr" + }, + "eu": { + "name": "Basque", + "nativeName": "Euskara", + "dir": "ltr" + }, + "fa": { + "name": "Persian", + "nativeName": "فارسی", + "dir": "rtl" + }, + "fi": { + "name": "Finnish", + "nativeName": "Suomi", + "dir": "ltr" + }, + "fil": { + "name": "Filipino", + "nativeName": "Filipino", + "dir": "ltr" + }, + "fj": { + "name": "Fijian", + "nativeName": "Na Vosa Vakaviti", + "dir": "ltr" + }, + "fo": { + "name": "Faroese", + "nativeName": "Føroyskt", + "dir": "ltr" + }, + "fr": { + "name": "French", + "nativeName": "Français", + "dir": "ltr" + }, + "fr-CA": { + "name": "French (Canada)", + "nativeName": "Français (Canada)", + "dir": "ltr" + }, + "ga": { + "name": "Irish", + "nativeName": "Gaeilge", + "dir": "ltr" + }, + "gl": { + "name": "Galician", + "nativeName": "Galego", + "dir": "ltr" + }, + "gu": { + "name": "Gujarati", + "nativeName": "ગુજરાતી", + "dir": "ltr" + }, + "he": { + "name": "Hebrew", + "nativeName": "עברית", + "dir": "rtl" + }, + "hi": { + "name": "Hindi", + "nativeName": "हिन्दी", + "dir": "ltr" + }, + "hr": { + "name": "Croatian", + "nativeName": "Hrvatski", + "dir": "ltr" + }, + "hsb": { + "name": "Upper Sorbian", + "nativeName": "Hornjoserbšćina", + "dir": "ltr" + }, + "ht": { + "name": "Haitian Creole", + "nativeName": "Haitian Creole", + "dir": "ltr" + }, + "hu": { + "name": "Hungarian", + "nativeName": "Magyar", + "dir": "ltr" + }, + "hy": { + "name": "Armenian", + "nativeName": "Հայերեն", + "dir": "ltr" + }, + "id": { + "name": "Indonesian", + "nativeName": "Indonesia", + "dir": "ltr" + }, + "ikt": { + "name": "Inuinnaqtun", + "nativeName": "Inuinnaqtun", + "dir": "ltr" + }, + "is": { + "name": "Icelandic", + "nativeName": "Íslenska", + "dir": "ltr" + }, + "it": { + "name": "Italian", + "nativeName": "Italiano", + "dir": "ltr" + }, + "iu": { + "name": "Inuktitut", + "nativeName": "ᐃᓄᒃᑎᑐᑦ", + "dir": "ltr" + }, + "iu-Latn": { + "name": "Inuktitut (Latin)", + "nativeName": "Inuktitut (Latin)", + "dir": "ltr" + }, + "ja": { + "name": "Japanese", + "nativeName": "日本語", + "dir": "ltr" + }, + "ka": { + "name": "Georgian", + "nativeName": "ქართული", + "dir": "ltr" + }, + "kk": { + "name": "Kazakh", + "nativeName": "Қазақ Тілі", + "dir": "ltr" + }, + "km": { + "name": "Khmer", + "nativeName": "ខ្មែរ", + "dir": "ltr" + }, + "kmr": { + "name": "Kurdish (Northern)", + "nativeName": "Kurdî (Bakur)", + "dir": "ltr" + }, + "kn": { + "name": "Kannada", + "nativeName": "ಕನ್ನಡ", + "dir": "ltr" + }, + "ko": { + "name": "Korean", + "nativeName": "한국어", + "dir": "ltr" + }, + "ku": { + "name": "Kurdish (Central)", + "nativeName": "Kurdî (Navîn)", + "dir": "rtl" + }, + "ky": { + "name": "Kyrgyz", + "nativeName": "Кыргызча", + "dir": "ltr" + }, + "lo": { + "name": "Lao", + "nativeName": "ລາວ", + "dir": "ltr" + }, + "lt": { + "name": "Lithuanian", + "nativeName": "Lietuvių", + "dir": "ltr" + }, + "lv": { + "name": "Latvian", + "nativeName": "Latviešu", + "dir": "ltr" + }, + "lzh": { + "name": "Chinese (Literary)", + "nativeName": "中文 (文言文)", + "dir": "ltr" + }, + "mg": { + "name": "Malagasy", + "nativeName": "Malagasy", + "dir": "ltr" + }, + "mi": { + "name": "Māori", + "nativeName": "Te Reo Māori", + "dir": "ltr" + }, + "mk": { + "name": "Macedonian", + "nativeName": "Македонски", + "dir": "ltr" + }, + "ml": { + "name": "Malayalam", + "nativeName": "മലയാളം", + "dir": "ltr" + }, + "mn-Cyrl": { + "name": "Mongolian (Cyrillic)", + "nativeName": "Mongolian (Cyrillic)", + "dir": "ltr" + }, + "mn-Mong": { + "name": "Mongolian (Traditional)", + "nativeName": "ᠮᠣᠩᠭᠣᠯ ᠬᠡᠯᠡ", + "dir": "ltr" + }, + "mr": { + "name": "Marathi", + "nativeName": "मराठी", + "dir": "ltr" + }, + "ms": { + "name": "Malay", + "nativeName": "Melayu", + "dir": "ltr" + }, + "mt": { + "name": "Maltese", + "nativeName": "Malti", + "dir": "ltr" + }, + "mww": { + "name": "Hmong Daw", + "nativeName": "Hmong Daw", + "dir": "ltr" + }, + "my": { + "name": "Myanmar (Burmese)", + "nativeName": "မြန်မာ", + "dir": "ltr" + }, + "nb": { + "name": "Norwegian", + "nativeName": "Norsk Bokmål", + "dir": "ltr" + }, + "ne": { + "name": "Nepali", + "nativeName": "नेपाली", + "dir": "ltr" + }, + "nl": { + "name": "Dutch", + "nativeName": "Nederlands", + "dir": "ltr" + }, + "or": { + "name": "Odia", + "nativeName": "ଓଡ଼ିଆ", + "dir": "ltr" + }, + "otq": { + "name": "Querétaro Otomi", + "nativeName": "Hñähñu", + "dir": "ltr" + }, + "pa": { + "name": "Punjabi", + "nativeName": "ਪੰਜਾਬੀ", + "dir": "ltr" + }, + "pl": { + "name": "Polish", + "nativeName": "Polski", + "dir": "ltr" + }, + "prs": { + "name": "Dari", + "nativeName": "دری", + "dir": "rtl" + }, + "ps": { + "name": "Pashto", + "nativeName": "پښتو", + "dir": "rtl" + }, + "pt": { + "name": "Portuguese (Brazil)", + "nativeName": "Português (Brasil)", + "dir": "ltr" + }, + "pt-PT": { + "name": "Portuguese (Portugal)", + "nativeName": "Português (Portugal)", + "dir": "ltr" + }, + "ro": { + "name": "Romanian", + "nativeName": "Română", + "dir": "ltr" + }, + "ru": { + "name": "Russian", + "nativeName": "Русский", + "dir": "ltr" + }, + "sk": { + "name": "Slovak", + "nativeName": "Slovenčina", + "dir": "ltr" + }, + "sl": { + "name": "Slovenian", + "nativeName": "Slovenščina", + "dir": "ltr" + }, + "sm": { + "name": "Samoan", + "nativeName": "Gagana Sāmoa", + "dir": "ltr" + }, + "so": { + "name": "Somali", + "nativeName": "Soomaali", + "dir": "ltr" + }, + "sq": { + "name": "Albanian", + "nativeName": "Shqip", + "dir": "ltr" + }, + "sr-Cyrl": { + "name": "Serbian (Cyrillic)", + "nativeName": "Српски (ћирилица)", + "dir": "ltr" + }, + "sr-Latn": { + "name": "Serbian (Latin)", + "nativeName": "Srpski (latinica)", + "dir": "ltr" + }, + "sv": { + "name": "Swedish", + "nativeName": "Svenska", + "dir": "ltr" + }, + "sw": { + "name": "Swahili", + "nativeName": "Kiswahili", + "dir": "ltr" + }, + "ta": { + "name": "Tamil", + "nativeName": "தமிழ்", + "dir": "ltr" + }, + "te": { + "name": "Telugu", + "nativeName": "తెలుగు", + "dir": "ltr" + }, + "th": { + "name": "Thai", + "nativeName": "ไทย", + "dir": "ltr" + }, + "ti": { + "name": "Tigrinya", + "nativeName": "ትግር", + "dir": "ltr" + }, + "tk": { + "name": "Turkmen", + "nativeName": "Türkmen Dili", + "dir": "ltr" + }, + "tlh-Latn": { + "name": "Klingon (Latin)", + "nativeName": "Klingon (Latin)", + "dir": "ltr" + }, + "tlh-Piqd": { + "name": "Klingon (pIqaD)", + "nativeName": "Klingon (pIqaD)", + "dir": "ltr" + }, + "to": { + "name": "Tongan", + "nativeName": "Lea Fakatonga", + "dir": "ltr" + }, + "tr": { + "name": "Turkish", + "nativeName": "Türkçe", + "dir": "ltr" + }, + "tt": { + "name": "Tatar", + "nativeName": "Татар", + "dir": "ltr" + }, + "ty": { + "name": "Tahitian", + "nativeName": "Reo Tahiti", + "dir": "ltr" + }, + "ug": { + "name": "Uyghur", + "nativeName": "ئۇيغۇرچە", + "dir": "rtl" + }, + "uk": { + "name": "Ukrainian", + "nativeName": "Українська", + "dir": "ltr" + }, + "ur": { + "name": "Urdu", + "nativeName": "اردو", + "dir": "rtl" + }, + "uz": { + "name": "Uzbek (Latin)", + "nativeName": "Uzbek (Latin)", + "dir": "ltr" + }, + "vi": { + "name": "Vietnamese", + "nativeName": "Tiếng Việt", + "dir": "ltr" + }, + "yua": { + "name": "Yucatec Maya", + "nativeName": "Yucatec Maya", + "dir": "ltr" + }, + "yue": { + "name": "Cantonese (Traditional)", + "nativeName": "粵語 (繁體)", + "dir": "ltr" + }, + "zh-Hans": { + "name": "Chinese Simplified", + "nativeName": "中文 (简体)", + "dir": "ltr" + }, + "zh-Hant": { + "name": "Chinese Traditional", + "nativeName": "繁體中文 (繁體)", + "dir": "ltr" + }, + "zu": { + "name": "Zulu", + "nativeName": "Isi-Zulu", + "dir": "ltr" + } + }, + "transliteration": { + "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": "Belarusian", + "scripts": [ + { + "code": "Cyrl", + "name": "Cyrillic", + "nativeName": "Cyrillic", + "dir": "ltr", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr", + "toScripts": [ + { + "code": "Cyrl", + "name": "Cyrillic", + "nativeName": "Cyrillic", + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "sd": { + "name": "Sindhi", + "nativeName": "سنڌي", + "scripts": [ + { + "code": "Arab", + "name": "Arabic", + "nativeName": "Arabic", + "dir": "ltr", + "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": "ltr" + } + ] + } + ] + }, + "si": { + "name": "Sinhala", + "nativeName": "සිංහල", + "scripts": [ + { + "code": "Sinh", + "name": "Sinhala", + "nativeName": "Sinhala", + "dir": "ltr", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr", + "toScripts": [ + { + "code": "Sinh", + "name": "Sinhala", + "nativeName": "Sinhala", + "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": "Cyrillic", + "dir": "ltr", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr", + "toScripts": [ + { + "code": "Cyrl", + "name": "Cyrillic", + "nativeName": "Cyrillic", + "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" + } + ] + } + ] + } + }, + "dictionary": { + "af": { + "name": "Afrikaans", + "nativeName": "Afrikaans", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ar": { + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "bg": { + "name": "Bulgarian", + "nativeName": "Български", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "bn": { + "name": "Bangla", + "nativeName": "বাংলা", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "bs": { + "name": "Bosnian", + "nativeName": "Bosnian", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ca": { + "name": "Catalan", + "nativeName": "Català", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "cs": { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "cy": { + "name": "Welsh", + "nativeName": "Cymraeg", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "da": { + "name": "Danish", + "nativeName": "Dansk", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "de": { + "name": "German", + "nativeName": "Deutsch", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "el": { + "name": "Greek", + "nativeName": "Ελληνικά", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "en": { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "translations": [ + { + "name": "Afrikaans", + "nativeName": "Afrikaans", + "dir": "ltr", + "code": "af" + }, + { + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl", + "code": "ar" + }, + { + "name": "Bulgarian", + "nativeName": "Български", + "dir": "ltr", + "code": "bg" + }, + { + "name": "Bangla", + "nativeName": "বাংলা", + "dir": "ltr", + "code": "bn" + }, + { + "name": "Bosnian", + "nativeName": "Bosnian", + "dir": "ltr", + "code": "bs" + }, + { + "name": "Catalan", + "nativeName": "Català", + "dir": "ltr", + "code": "ca" + }, + { + "name": "Chinese Simplified", + "nativeName": "中文 (简体)", + "dir": "ltr", + "code": "zh-Hans" + }, + { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr", + "code": "cs" + }, + { + "name": "Welsh", + "nativeName": "Cymraeg", + "dir": "ltr", + "code": "cy" + }, + { + "name": "Danish", + "nativeName": "Dansk", + "dir": "ltr", + "code": "da" + }, + { + "name": "German", + "nativeName": "Deutsch", + "dir": "ltr", + "code": "de" + }, + { + "name": "Greek", + "nativeName": "Ελληνικά", + "dir": "ltr", + "code": "el" + }, + { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr", + "code": "es" + }, + { + "name": "Estonian", + "nativeName": "Eesti", + "dir": "ltr", + "code": "et" + }, + { + "name": "Persian", + "nativeName": "فارسی", + "dir": "rtl", + "code": "fa" + }, + { + "name": "Finnish", + "nativeName": "Suomi", + "dir": "ltr", + "code": "fi" + }, + { + "name": "French", + "nativeName": "Français", + "dir": "ltr", + "code": "fr" + }, + { + "name": "Hebrew", + "nativeName": "עברית", + "dir": "rtl", + "code": "he" + }, + { + "name": "Hindi", + "nativeName": "हिन्दी", + "dir": "ltr", + "code": "hi" + }, + { + "name": "Croatian", + "nativeName": "Hrvatski", + "dir": "ltr", + "code": "hr" + }, + { + "name": "Hungarian", + "nativeName": "Magyar", + "dir": "ltr", + "code": "hu" + }, + { + "name": "Indonesian", + "nativeName": "Indonesia", + "dir": "ltr", + "code": "id" + }, + { + "name": "Icelandic", + "nativeName": "Íslenska", + "dir": "ltr", + "code": "is" + }, + { + "name": "Italian", + "nativeName": "Italiano", + "dir": "ltr", + "code": "it" + }, + { + "name": "Japanese", + "nativeName": "日本語", + "dir": "ltr", + "code": "ja" + }, + { + "name": "Korean", + "nativeName": "한국어", + "dir": "ltr", + "code": "ko" + }, + { + "name": "Lithuanian", + "nativeName": "Lietuvių", + "dir": "ltr", + "code": "lt" + }, + { + "name": "Latvian", + "nativeName": "Latviešu", + "dir": "ltr", + "code": "lv" + }, + { + "name": "Maltese", + "nativeName": "Malti", + "dir": "ltr", + "code": "mt" + }, + { + "name": "Malay", + "nativeName": "Melayu", + "dir": "ltr", + "code": "ms" + }, + { + "name": "Hmong Daw", + "nativeName": "Hmong Daw", + "dir": "ltr", + "code": "mww" + }, + { + "name": "Dutch", + "nativeName": "Nederlands", + "dir": "ltr", + "code": "nl" + }, + { + "name": "Norwegian", + "nativeName": "Norsk Bokmål", + "dir": "ltr", + "code": "nb" + }, + { + "name": "Polish", + "nativeName": "Polski", + "dir": "ltr", + "code": "pl" + }, + { + "name": "Portuguese (Brazil)", + "nativeName": "Português (Brasil)", + "dir": "ltr", + "code": "pt" + }, + { + "name": "Romanian", + "nativeName": "Română", + "dir": "ltr", + "code": "ro" + }, + { + "name": "Russian", + "nativeName": "Русский", + "dir": "ltr", + "code": "ru" + }, + { + "name": "Slovak", + "nativeName": "Slovenčina", + "dir": "ltr", + "code": "sk" + }, + { + "name": "Slovenian", + "nativeName": "Slovenščina", + "dir": "ltr", + "code": "sl" + }, + { + "name": "Serbian (Latin)", + "nativeName": "Srpski (latinica)", + "dir": "ltr", + "code": "sr-Latn" + }, + { + "name": "Swedish", + "nativeName": "Svenska", + "dir": "ltr", + "code": "sv" + }, + { + "name": "Swahili", + "nativeName": "Kiswahili", + "dir": "ltr", + "code": "sw" + }, + { + "name": "Tamil", + "nativeName": "தமிழ்", + "dir": "ltr", + "code": "ta" + }, + { + "name": "Thai", + "nativeName": "ไทย", + "dir": "ltr", + "code": "th" + }, + { + "name": "Klingon (Latin)", + "nativeName": "Klingon (Latin)", + "dir": "ltr", + "code": "tlh-Latn" + }, + { + "name": "Turkish", + "nativeName": "Türkçe", + "dir": "ltr", + "code": "tr" + }, + { + "name": "Ukrainian", + "nativeName": "Українська", + "dir": "ltr", + "code": "uk" + }, + { + "name": "Urdu", + "nativeName": "اردو", + "dir": "rtl", + "code": "ur" + }, + { + "name": "Vietnamese", + "nativeName": "Tiếng Việt", + "dir": "ltr", + "code": "vi" + } + ] + }, + "es": { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "et": { + "name": "Estonian", + "nativeName": "Eesti", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "fa": { + "name": "Persian", + "nativeName": "فارسی", + "dir": "rtl", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "fi": { + "name": "Finnish", + "nativeName": "Suomi", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "fr": { + "name": "French", + "nativeName": "Français", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "he": { + "name": "Hebrew", + "nativeName": "עברית", + "dir": "rtl", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "hi": { + "name": "Hindi", + "nativeName": "हिन्दी", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "hr": { + "name": "Croatian", + "nativeName": "Hrvatski", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "hu": { + "name": "Hungarian", + "nativeName": "Magyar", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "id": { + "name": "Indonesian", + "nativeName": "Indonesia", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "is": { + "name": "Icelandic", + "nativeName": "Íslenska", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "it": { + "name": "Italian", + "nativeName": "Italiano", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ja": { + "name": "Japanese", + "nativeName": "日本語", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ko": { + "name": "Korean", + "nativeName": "한국어", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "lt": { + "name": "Lithuanian", + "nativeName": "Lietuvių", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "lv": { + "name": "Latvian", + "nativeName": "Latviešu", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ms": { + "name": "Malay", + "nativeName": "Melayu", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "mt": { + "name": "Maltese", + "nativeName": "Malti", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "mww": { + "name": "Hmong Daw", + "nativeName": "Hmong Daw", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "nb": { + "name": "Norwegian", + "nativeName": "Norsk Bokmål", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "nl": { + "name": "Dutch", + "nativeName": "Nederlands", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "pl": { + "name": "Polish", + "nativeName": "Polski", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "pt": { + "name": "Portuguese (Brazil)", + "nativeName": "Português (Brasil)", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ro": { + "name": "Romanian", + "nativeName": "Română", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ru": { + "name": "Russian", + "nativeName": "Русский", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sk": { + "name": "Slovak", + "nativeName": "Slovenčina", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sl": { + "name": "Slovenian", + "nativeName": "Slovenščina", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sr-Latn": { + "name": "Serbian (Latin)", + "nativeName": "Srpski (latinica)", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sv": { + "name": "Swedish", + "nativeName": "Svenska", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sw": { + "name": "Swahili", + "nativeName": "Kiswahili", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ta": { + "name": "Tamil", + "nativeName": "தமிழ்", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "th": { + "name": "Thai", + "nativeName": "ไทย", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "tlh-Latn": { + "name": "Klingon (Latin)", + "nativeName": "Klingon (Latin)", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "tr": { + "name": "Turkish", + "nativeName": "Türkçe", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "uk": { + "name": "Ukrainian", + "nativeName": "Українська", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ur": { + "name": "Urdu", + "nativeName": "اردو", + "dir": "rtl", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "vi": { + "name": "Vietnamese", + "nativeName": "Tiếng Việt", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "zh-Hans": { + "name": "Chinese Simplified", + "nativeName": "中文 (简体)", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + } + } + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/cognitiveservices/translator/examples/3.0/Translate.json b/specification/cognitiveservices/translator/examples/3.0/Translate.json new file mode 100644 index 000000000000..97e5c24c533e --- /dev/null +++ b/specification/cognitiveservices/translator/examples/3.0/Translate.json @@ -0,0 +1,41 @@ +{ + "operationId": "Translator_TextTranslation_Translate", + "title": "Translate specified source language text into the target language text.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "To": "cs", + "body": [ + {"Text":"This is a test."} + ] + }, + "responses": { + "200": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/cognitiveservices/translator/examples/3.0/Transliterate.json b/specification/cognitiveservices/translator/examples/3.0/Transliterate.json new file mode 100644 index 000000000000..b4a2617c752b --- /dev/null +++ b/specification/cognitiveservices/translator/examples/3.0/Transliterate.json @@ -0,0 +1,35 @@ +{ + "operationId": "Translator_TextTranslation_Transliterate", + "title": "Map source language script or alphabet to a target language script or alphabet.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "Language": "zh-Hans", + "FromScript": "Hans", + "ToScript": "Latn", + "body": [ + {"Text":"这是个测试。"} + ] + }, + "responses": { + "200": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/cognitiveservices/translator/main.cadl b/specification/cognitiveservices/translator/main.cadl new file mode 100644 index 000000000000..3d7c2b7f28f4 --- /dev/null +++ b/specification/cognitiveservices/translator/main.cadl @@ -0,0 +1,49 @@ +import "@cadl-lang/rest"; +import "@cadl-lang/versioning"; +import "@azure-tools/cadl-azure-core"; +import "./text-translation/routes.cadl"; + +using Cadl.Rest; +using Cadl.Http; +using Azure.Core; +using Cadl.Versioning; + +@service({title: "Text Translation"}) +@server( + "{Endpoint}", + "Text translation is a cloud-based REST API feature of the Translator service that uses neural machine translation technology to enable quick and accurate source-to-target text translation in real time across all supported languages.", + { + @doc(""" +Supported Text Translation endpoints (protocol and hostname, for example: + https://api.cognitive.microsofttranslator.com). +""") + Endpoint: url + } +) + +@doc(""" +Text translation is a cloud-based REST API feature of the Translator service that uses neural +machine translation technology to enable quick and accurate source-to-target text translation +in real time across all supported languages. + +The following methods are supported by the Text Translation feature: + +Languages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations. + +Translate. Renders single source-language text to multiple target-language texts with a single request. + +Transliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language. + +Detect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration. + +Dictionary lookup. Returns equivalent words for the source term in the target language. + +Dictionary example Returns grammatical structure and context examples for the source term and target term pair. +""") +@versioned(APIVersion) +namespace Translator; + +@doc("Translatpr supported versions") +enum APIVersion { + v3_0: "3.0", +} diff --git a/specification/cognitiveservices/translator/package.json b/specification/cognitiveservices/translator/package.json new file mode 100644 index 000000000000..8ac35d57e0c0 --- /dev/null +++ b/specification/cognitiveservices/translator/package.json @@ -0,0 +1,20 @@ +{ + "name": "@cadl-api-spec/translator", + "author": "Microsoft Corporation", + "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural machine translation technology to enable quick and accurate source-to-target text translation in real time across all supported languages.", + "license": "MIT", + "dependencies": { + "@azure-tools/cadl-autorest": "latest", + "@azure-tools/cadl-azure-core": "latest", + "@azure-tools/cadl-csharp": "latest", + "@azure-tools/cadl-java": "latest", + "@azure-tools/cadl-typescript": "latest", + "@azure-tools/cadl-dpg": "latest", + "@azure-tools/cadl-python": "latest", + "@cadl-lang/compiler": "latest", + "@cadl-lang/prettier-plugin-cadl": "latest", + "@cadl-lang/rest": "latest", + "@cadl-lang/versioning": "latest" + }, + "private": true +} diff --git a/specification/cognitiveservices/translator/text-translation/models-breaksentence.cadl b/specification/cognitiveservices/translator/text-translation/models-breaksentence.cadl new file mode 100644 index 000000000000..eb2261c3e5ee --- /dev/null +++ b/specification/cognitiveservices/translator/text-translation/models-breaksentence.cadl @@ -0,0 +1,54 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; +import "./models-shared.cadl"; +import "./models-translate.cadl"; + +using Cadl.Http; +using Cadl.Rest; +using Azure.Core; + +namespace Translator.TextTranslation; + +@doc("Request parameters for the break sentence API.") +model BreakSentenceParameters { + ...CommonParameters; + + @query + @doc(""" + Language tag identifying the language of the input text. + If a code isn't specified, automatic language detection will be applied. + """) + language?: string; + + @query + @doc(""" + Script tag identifying the script used by the input text. + If a script isn't specified, the default script of the language will be assumed. + """) + script?: string; + + @body + @doc("Array of the text for which values the sentence boundaries will be calculated.") + content: InputTextElement[]; +} + +@doc("Response for the Break SEntence API.") +model BreakSentenceResult { + ...CommonResultHeaders; + + @body + @doc("Array of the break sentence elements.") + result: BreakSentenceElement[]; +} + +@doc("Elemented containing break sentence result.") +model BreakSentenceElement { + @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") + detectedLanguage?: DetectedLanguage; + + @doc(""" + An integer array representing the lengths of the sentences in the input text. + The length of the array is the number of sentences, and the values are the length of each sentence. + """) + sentLen: int32[]; +} diff --git a/specification/cognitiveservices/translator/text-translation/models-dictionary.cadl b/specification/cognitiveservices/translator/text-translation/models-dictionary.cadl new file mode 100644 index 000000000000..8e2cd18134b6 --- /dev/null +++ b/specification/cognitiveservices/translator/text-translation/models-dictionary.cadl @@ -0,0 +1,232 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; +import "./models-shared.cadl"; + +using Cadl.Http; +using Cadl.Rest; +using Azure.Core; + +namespace Translator.TextTranslation; + +alias DictionaryBaseParameters = { + ...CommonParameters; + + @query + @doc(""" + Specifies the language of the input text. + The source language must be one of the supported languages included in the dictionary scope. + """) + from: string; + + @query + @doc(""" + Specifies the language of the output text. + The target language must be one of the supported languages included in the dictionary scope. + """) + to: string; +}; + +@doc("Request parameters for the dictionary lookup API.") +model DictionaryLookupParamters { + ...DictionaryBaseParameters; + + @body + @doc("Array of the text to be sent to dictionary.") + content: InputTextElement[]; +} + +@doc("Request paramters for the dictionary examples API.") +model DictionaryExamplesParamters { + ...DictionaryBaseParameters; + + @body + @doc("Array of the text to be sent to dictionary.") + content: DictionaryExampleTextElement[]; +} + +@doc("Response for the dictionary lookup API.") +model DictionaryLookupResult { + ...CommonResultHeaders; + + @body + @doc("Array of the dictionary lookup elements.") + result: DictionaryLookupElement[]; +} + +@doc("Response for the dictionary examples API.") +model DictionaryExamplesResult { + ...CommonResultHeaders; + + @body + @doc("Array of the dictionary examples elements.") + result: DictionaryExampleElement[]; +} + +@doc("Element containing the text with translation.") +model DictionaryExampleTextElement extends InputTextElement { + @doc(""" + A string specifying the translated text previously returned by the Dictionary lookup operation. + This should be the value from the normalizedTarget field in the translations list of the Dictionary + lookup response. The service will return examples for the specific source-target word-pair. + """) + translation: string; +} + +@doc("Dictionary Lookup Element") +model DictionaryLookupElement { + @doc(""" + A string giving the normalized form of the source term. + For example, if the request is "JOHN", the normalized form will be "john". + The content of this field becomes the input to lookup examples. + """) + normalizedSource: string; + + @doc(""" + A string giving the source term in a form best suited for end-user display. + For example, if the input is "JOHN", the display form will reflect the usual + spelling of the name: "John". + """) + displaySource: string; + + @doc(""" + A list of translations for the source term. + """) + translations: DictionaryTranslation[]; +} + +@doc("Translation source term.") +model DictionaryTranslation { + @doc(""" + A string giving the normalized form of this term in the target language. + This value should be used as input to lookup examples. + """) + normalizedTarget: string; + + @doc(""" + A string giving the term in the target language and in a form best suited + for end-user display. Generally, this will only differ from the normalizedTarget + in terms of capitalization. For example, a proper noun like "Juan" will have + normalizedTarget = "juan" and displayTarget = "Juan". + """) + displayTarget: string; + + @doc(""" + A string associating this term with a part-of-speech tag. + """) + posTag: string; + + @doc(""" + A value between 0.0 and 1.0 which represents the "confidence" + (or perhaps more accurately, "probability in the training data") of that translation pair. + The sum of confidence scores for one source word may or may not sum to 1.0. + """) + confidence: float32; + + @doc(""" + A string giving the word to display as a prefix of the translation. Currently, + this is the gendered determiner of nouns, in languages that have gendered determiners. + For example, the prefix of the Spanish word "mosca" is "la", since "mosca" is a feminine noun in Spanish. + This is only dependent on the translation, and not on the source. + If there is no prefix, it will be the empty string. + """) + prefixWord: string; + + @doc(""" + A list of "back translations" of the target. For example, source words that the target can translate to. + The list is guaranteed to contain the source word that was requested (e.g., if the source word being + looked up is "fly", then it is guaranteed that "fly" will be in the backTranslations list). + However, it is not guaranteed to be in the first position, and often will not be. + """) + backTranslations: BackTranslation[]; +} + +@doc("Back Translation") +model BackTranslation { + @doc(""" + A string giving the normalized form of the source term that is a back-translation of the target. + This value should be used as input to lookup examples. + """) + normalizedText: string; + + @doc(""" + A string giving the source term that is a back-translation of the target in a form best + suited for end-user display. + """) + displayText: string; + + @doc(""" + An integer representing the number of examples that are available for this translation pair. + Actual examples must be retrieved with a separate call to lookup examples. The number is mostly + intended to facilitate display in a UX. For example, a user interface may add a hyperlink + to the back-translation if the number of examples is greater than zero and show the back-translation + as plain text if there are no examples. Note that the actual number of examples returned + by a call to lookup examples may be less than numExamples, because additional filtering may be + applied on the fly to remove "bad" examples. + """) + numExamples: int32; + + @doc(""" + An integer representing the frequency of this translation pair in the data. The main purpose of this + field is to provide a user interface with a means to sort back-translations so the most frequent terms are first. + """) + frequencyCount: int32; +} + +@doc("Dictionary Example element") +model DictionaryExampleElement { + @doc(""" + A string giving the normalized form of the source term. Generally, this should be identical + to the value of the Text field at the matching list index in the body of the request. + """) + normalizedSource: string; + + @doc(""" + A string giving the normalized form of the target term. Generally, this should be identical + to the value of the Translation field at the matching list index in the body of the request. + """) + normalizedTarget: string; + + @doc(""" + A list of examples for the (source term, target term) pair. + """) + examples: Example[]; +} + +@doc("Dictionary Example") +model Example { + @doc(""" + The string to concatenate before the value of sourceTerm to form a complete example. + Do not add a space character, since it is already there when it should be. + This value may be an empty string. + """) + sourcePrefix: string; + + @doc(""" + A string equal to the actual term looked up. The string is added with sourcePrefix + and sourceSuffix to form the complete example. Its value is separated so it can be + marked in a user interface, e.g., by bolding it. + """) + sourceTerm: string; + + @doc(""" + The string to concatenate after the value of sourceTerm to form a complete example. + Do not add a space character, since it is already there when it should be. + This value may be an empty string. + """) + sourceSuffix: string; + + @doc(""" + A string similar to sourcePrefix but for the target. + """) + targetPrefix: string; + + @doc(""" + A string similar to sourceTerm but for the target. + """) + targetTerm: string; + + @doc(""" + A string similar to sourceSuffix but for the target. + """) + targetSuffix: string; +} diff --git a/specification/cognitiveservices/translator/text-translation/models-languages.cadl b/specification/cognitiveservices/translator/text-translation/models-languages.cadl new file mode 100644 index 000000000000..53da21c9511c --- /dev/null +++ b/specification/cognitiveservices/translator/text-translation/models-languages.cadl @@ -0,0 +1,139 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; +import "./models-shared.cadl"; + +using Cadl.Http; +using Cadl.Rest; +using Azure.Core; + +namespace Translator.TextTranslation; + +@doc("Request parameters for the language API.") +model GetLanguageParameters { + ...CommonParameters; + + @query + @doc(""" + A comma-separated list of names defining the group of languages to return. + Allowed group names are: `translation`, `transliteration` and `dictionary`. + If no scope is given, then all groups are returned, which is equivalent to passing + `scope=translation,transliteration,dictionary`. To decide which set of supported languages + is appropriate for your scenario, see the description of the [response object](#response-body). + """) + scope?: string; + + @header("Accept-Language") + @doc(""" + The language to use for user interface strings. Some of the fields in the response are names of languages or + names of regions. Use this parameter to define the language in which these names are returned. + The language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr` + to request names in French or use the value `zh-Hant` to request names in Chinese Traditional. + Names are provided in the English language when a target language is not specified or when localization + is not available. + """) + acceptLanguage?: string = "en"; + + @header("If-None-Match") + @doc(""" + Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response. + If the resource has not been modified, the service will return status code 304 and an empty response body. + """) + ifNoneMatch?: string; +} + +@doc("Response for the languages API.") +model GetLanguagesResult { + ...CommonResultHeaders; + + @header("ETag") + @doc(""" + Current value of the entity tag for the requested groups of supported languages. + To make subsequent requests more efficient, the client may send the `ETag` value in an + `If-None-Match` header field. + """) + etag: string; + + @doc("Languages that support translate API.") + translation?: Record; + + @doc("Languages that support transliteration API.") + transliteration?: Record; + + @doc("Languages that support dictionary API.") + dictionary?: Record; +} + +alias CommonLanguageModel = { + @doc("Display name of the language in the locale requested via Accept-Language header.") + name: string; + + @doc("Display name of the language in the locale native for this language.") + nativeName: string; +}; + +@doc(""" +The value of the translation property is a dictionary of (key, value) pairs. Each key is a BCP 47 language tag. +A key identifies a language for which text can be translated to or translated from. +""") +model TranslationLanguage { + ...CommonLanguageModel; + + @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") + dir: string; +} + +@doc(""" +The value of the transliteration property is a dictionary of (key, value) pairs. +Each key is a BCP 47 language tag. A key identifies a language for which text can be converted from one script +to another script. +""") +model TransliterationLanguage { + ...CommonLanguageModel; + + @doc("List of scripts to convert from.") + scripts: TransliterableScript[]; +} + +@doc("Script definition with list of script into which given script can be translitered.") +model TransliterableScript extends CommonScriptModel { + @doc("List of scripts available to convert text to.") + toScripts: CommonScriptModel[]; +} + +@doc("Common properties of language script") +model CommonScriptModel { + @doc("Code identifying the script.") + code: string; + + @doc("Display name of the script in the locale requested via Accept-Language header.") + name: string; + + @doc("Display name of the language in the locale native for the language.") + nativeName: string; + + @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") + dir: string; +} + +alias CommonDictionaryLanguageModel = { + ...CommonLanguageModel; + + @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") + dir: string; +}; + +@doc("Properties ot the source dictionary language") +model SourceDictionaryLanguage { + ...CommonDictionaryLanguageModel; + + @doc("List of languages with alterative translations and examples for the query expressed in the source language.") + translations: TargetDictionaryLanguage[]; +} + +@doc("Properties of the target dictionary language") +model TargetDictionaryLanguage { + ...CommonDictionaryLanguageModel; + + @doc("Language code identifying the target language.") + code: string; +} diff --git a/specification/cognitiveservices/translator/text-translation/models-shared.cadl b/specification/cognitiveservices/translator/text-translation/models-shared.cadl new file mode 100644 index 000000000000..7005a49ea6b3 --- /dev/null +++ b/specification/cognitiveservices/translator/text-translation/models-shared.cadl @@ -0,0 +1,48 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; + +using Cadl.Http; +using Cadl.Rest; +using Azure.Core; + +namespace Translator.TextTranslation; + +alias CommonParameters = { + @header("X-ClientTraceId") + @doc(""" + A client-generated GUID to uniquely identify the request. + """) + clientTraceId?: string; +}; + +@doc("Element containing the text for translation.") +model InputTextElement { + @doc("Text to translate.") + text: string; +} + +alias CommonResultHeaders = { + @header("X-RequestId") + @doc(""" + Value generated by the service to identify the request. It is used for troubleshooting purposes. + """) + requestId: string; +}; + +@doc("Representation of the Error Response from Translator Service.") +@error +model MtErrorResponse { + ...CommonResultHeaders; + + @doc("Error details.") + error: ErrorDetails; +} + +@doc("Error details as returned by Translator Service.") +model ErrorDetails { + @doc("Number indetifier of the error.") + code: int32; + + @doc("Human readable error description.") + message: string; +} diff --git a/specification/cognitiveservices/translator/text-translation/models-translate.cadl b/specification/cognitiveservices/translator/text-translation/models-translate.cadl new file mode 100644 index 000000000000..d3203168b8e2 --- /dev/null +++ b/specification/cognitiveservices/translator/text-translation/models-translate.cadl @@ -0,0 +1,264 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; +import "./models-shared.cadl"; + +using Cadl.Http; +using Cadl.Rest; +using Azure.Core; + +namespace Translator.TextTranslation; + +@doc("Request parameters for the translate API.") +model TranslateParameters { + ...CommonParameters; + + @query + @doc(""" + Specifies the language of the output text. The target language must be one of the supported languages included + in the translation scope. For example, use to=de to translate to German. + It's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. + For example, use to=de&to=it to translate to German and Italian. + """) + to: string[]; + + @query + @doc(""" + Specifies the language of the input text. Find which languages are available to translate from by + looking up supported languages using the translation scope. If the from parameter isn't specified, + automatic language detection is applied to determine the source language. + + You must use the from parameter rather than autodetection when using the dynamic dictionary feature. + Note: the dynamic dictionary feature is case-sensitive. + """) + from?: string; + + @query + @doc(""" + Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, + complete element. Possible values are: plain (default) or html. + """) + textType?: TextTypes = TextTypes.plain; + + @query + @doc(""" + A string specifying the category (domain) of the translation. This parameter is used to get translations + from a customized system built with Custom Translator. Add the Category ID from your Custom Translator + project details to this parameter to use your deployed customized system. Default value is: general. + """) + category?: string = "general"; + + @query + @doc(""" + Specifies how profanities should be treated in translations. + Possible values are: NoAction (default), Marked or Deleted. + """) + profanityAction?: ProfanityActions = ProfanityActions.NoAction; + + @query + @doc(""" + Specifies how profanities should be marked in translations. + Possible values are: Asterisk (default) or Tag. + """) + profanityMarker?: ProfanityMarkers = ProfanityMarkers.Asterisk; + + @query + @doc(""" + Specifies whether to include alignment projection from source text to translated text. + Possible values are: true or false (default). + """) + includeAlignment?: boolean = false; + + @query + @doc(""" + Specifies whether to include sentence boundaries for the input text and the translated text. + Possible values are: true or false (default). + """) + includeSentenceLength?: boolean = false; + + @query + @doc(""" + Specifies a fallback language if the language of the input text can't be identified. + Language autodetection is applied when the from parameter is omitted. If detection fails, + the suggestedFrom language will be assumed. + """) + suggestedFrom?: string; + + @query + @doc(""" + Specifies the script of the input text. + """) + fromScript?: string; + + @query + @doc(""" + Specifies the script of the translated text. + """) + toScript?: string; + + @query + @doc(""" + Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + Possible values are: true (default) or false. + + allowFallback=false specifies that the translation should only use systems trained for the category specified + by the request. If a translation for language X to language Y requires chaining through a pivot language E, + then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. + If no system is found with the specific category, the request will return a 400 status code. allowFallback=true + specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + """) + allowFallback?: boolean = true; + + @body + @doc("Array of the text to be translated.") + content: InputTextElement[]; +} + +@doc("Response for the translation API.") +model TranslationResult { + ...CommonResultHeaders; + + @body + @doc("Array of the translated text elements.") + result: TranslatedTextElement[]; + + @header("x-mt-system") + @doc(""" + Specifies the system type that was used for translation for each 'to' language requested for translation. + The value is a comma-separated list of strings. Each string indicates a type: + + * Custom - Request includes a custom system and at least one custom system was used during translation. + * Team - All other requests + """) + mtSystem: string; + + @header("x-metered-usage") + @doc(""" + Specifies consumption (the number of characters for which the user will be charged) for the translation + job request. For example, if the word "Hello" is translated from English (en) to French (fr), + this field will return the value '5'. + """) + meteredUsage: int32; +} + +@fixed +@doc("Translation text type") +enum TextTypes { + plain, + html +} + +@fixed +@doc("Translator profanity actions") +enum ProfanityActions { + NoAction, + Marked, + Deleted +} + +@fixed +@doc("Translator profanity markers") +enum ProfanityMarkers { + Asterisk, + Tag +} + +@doc("Element containing the translated text") +model TranslatedTextElement { + @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") + detectedLanguage?: DetectedLanguage; + + @doc(""" + An array of translation results. The size of the array matches the number of target + languages specified through the to query parameter. + """) + translations: Translation[]; + + @doc(""" + Input text in the default script of the source language. sourceText property is present only when + the input is expressed in a script that's not the usual script for the language. For example, + if the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text + converted into Arab script. + """) + sourceText?: SourceText; +} + +@doc("An object describing the detected language.") +model DetectedLanguage { + @doc("A string representing the code of the detected language.") + language: string; + + @doc(""" + A float value indicating the confidence in the result. + The score is between zero and one and a low score indicates a low confidence. + """) + score: float32; +} + +@doc("Translation result") +model Translation { + @doc("A string representing the language code of the target language.") + to: string; + + @doc("A string giving the translated text.") + text: string; + + @doc(""" + An object giving the translated text in the script specified by the toScript parameter. + """) + transliteration?: Transliteration; + + @doc(""" + Alignment information. + """) + alignment?: Alignment; + + @doc(""" + Sentence boundaries in the input and output texts. + """) + sentLen?: SentenceLength; +} + +@doc("An object giving the translated text in the script specified by the toScript parameter.") +model Transliteration { + @doc("A string specifying the target script.") + script: string; + + @doc("A string giving the translated text in the target script.") + text: string; +} + +@doc("Alignment information object.") +model Alignment { + @doc(""" + Maps input text to translated text. The alignment information is only provided when the request + parameter includeAlignment is true. Alignment is returned as a string value of the following + format: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. + The colon separates start and end index, the dash separates the languages, and space separates the words. + One word may align with zero, one, or multiple words in the other language, and the aligned words may + be non-contiguous. When no alignment information is available, the alignment element will be empty. + """) + proj: string; +} + +@doc("An object returning sentence boundaries in the input and output texts.") +model SentenceLength { + @doc(""" + An integer array representing the lengths of the sentences in the input text. + The length of the array is the number of sentences, and the values are the length of each sentence. + """) + srcSentLen: int32[]; + + @doc(""" + An integer array representing the lengths of the sentences in the translated text. + The length of the array is the number of sentences, and the values are the length of each sentence. + """) + transSentLen: int32[]; +} + +@doc("Input text in the default script of the source language. ") +model SourceText { + @doc(""" + Input text in the default script of the source language. + """) + text: string; +} diff --git a/specification/cognitiveservices/translator/text-translation/models-transliterate.cadl b/specification/cognitiveservices/translator/text-translation/models-transliterate.cadl new file mode 100644 index 000000000000..f344779284d5 --- /dev/null +++ b/specification/cognitiveservices/translator/text-translation/models-transliterate.cadl @@ -0,0 +1,58 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; +import "./models-shared.cadl"; + +using Cadl.Http; +using Cadl.Rest; +using Azure.Core; + +namespace Translator.TextTranslation; + +@doc("Request parameters for the transliterate API.") +model TransliterateParameters { + ...CommonParameters; + + @query + @doc(""" + Specifies the language of the text to convert from one script to another. + Possible languages are listed in the transliteration scope obtained by querying the service + for its supported languages. + """) + language: string; + + @query + @doc(""" + Specifies the script used by the input text. Look up supported languages using the transliteration scope, + to find input scripts available for the selected language. + """) + fromScript: string; + + @query + @doc(""" + Specifies the output script. Look up supported languages using the transliteration scope, to find output + scripts available for the selected combination of input language and input script. + """) + toScript: string; + + @body + @doc("Array of the text to be transliterated.") + content: InputTextElement[]; +} + +@doc("Response for the transliteration API.") +model TransliterateResult { + ...CommonResultHeaders; + + @body + @doc("Array of transliterated texts") + result: TransliteratedText[]; +} + +@doc("Transliterated text element.") +model TransliteratedText { + @doc("A string which is the result of converting the input string to the output script.") + text: string; + + @doc("A string specifying the script used in the output.") + script: string; +} diff --git a/specification/cognitiveservices/translator/text-translation/routes.cadl b/specification/cognitiveservices/translator/text-translation/routes.cadl new file mode 100644 index 000000000000..26fe9cb4e8e5 --- /dev/null +++ b/specification/cognitiveservices/translator/text-translation/routes.cadl @@ -0,0 +1,54 @@ +import "@cadl-lang/rest"; +import "@azure-tools/cadl-azure-core"; +import "./models-languages.cadl"; +import "./models-translate.cadl"; +import "./models-transliterate.cadl"; +import "./models-breaksentence.cadl"; +import "./models-dictionary.cadl"; + +using Azure.Core; +using Cadl.Rest; +using Cadl.Http; + +namespace Translator.TextTranslation; + +op CustomOperation( + ...TParams, + @query("api-version") + apiVersion: string): TResponse | TError; + +@get +@route("languages") +@summary("Gets the set of languages currently supported by other operations of the Translator.") +@doc("Gets the set of languages currently supported by other operations of the Translator.") +op GetLanguages is CustomOperation; + +@post +@route("translate") +@summary("Translate Text") +@doc("Translate Text") +op Translate is CustomOperation; + +@post +@route("transliterate") +@summary("Transliterate Text") +@doc("Transliterate Text") +op Transliterate is CustomOperation; + +@post +@route("breaksentence") +@summary("Break Sentence") +@doc("Break Sentence") +op BreakSentence is CustomOperation; + +@post +@route("dictionary/lookup") +@summary("Dictionary Lookup") +@doc("Dictionary Lookup") +op DictionaryLookup is CustomOperation; + +@post +@route("dictionary/examples") +@summary("Dictionary Examples") +@doc("Dictionary Examples") +op DictionaryExamples is CustomOperation; From e3324193cb55c22e1426180b949e457719fcc0a0 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Wed, 15 Mar 2023 13:22:51 -0700 Subject: [PATCH 02/27] Fix the packages names --- .../translator/cadl-project.yaml | 10 +++---- .../cognitiveservices/translator/main.cadl | 6 ++-- .../models-breaksentence.cadl | 2 +- .../models-dictionary.cadl | 2 +- .../models-languages.cadl | 2 +- .../{text-translation => }/models-shared.cadl | 4 +-- .../models-translate.cadl | 6 ++-- .../models-transliterate.cadl | 2 +- .../{text-translation => }/routes.cadl | 28 +++++++++---------- 9 files changed, 31 insertions(+), 31 deletions(-) rename specification/cognitiveservices/translator/{text-translation => }/models-breaksentence.cadl (97%) rename specification/cognitiveservices/translator/{text-translation => }/models-dictionary.cadl (99%) rename specification/cognitiveservices/translator/{text-translation => }/models-languages.cadl (99%) rename specification/cognitiveservices/translator/{text-translation => }/models-shared.cadl (94%) rename specification/cognitiveservices/translator/{text-translation => }/models-translate.cadl (99%) rename specification/cognitiveservices/translator/{text-translation => }/models-transliterate.cadl (97%) rename specification/cognitiveservices/translator/{text-translation => }/routes.cadl (57%) diff --git a/specification/cognitiveservices/translator/cadl-project.yaml b/specification/cognitiveservices/translator/cadl-project.yaml index 8a532bf9879b..72c59f19c4e1 100644 --- a/specification/cognitiveservices/translator/cadl-project.yaml +++ b/specification/cognitiveservices/translator/cadl-project.yaml @@ -7,20 +7,20 @@ emit: [ options: "@azure-tools/cadl-csharp": clear-output-folder: true - namespace: Azure.AI.TextTranslator - model-namespace: true + namespace: Azure.AI.Translation.Text + model-namespace: false "@azure-tools/cadl-python": "basic-setup-py": true "package-version": 1.0.0b1 "package-name": azure-ai-translation-text "@azure-tools/cadl-java": "emitter-output-dir": "cadl-output/@azure-tools/cadl-java" - namespace: com.azure.ai.texttranslator + namespace: com.azure.ai.translation.text "@azure-tools/cadl-typescript": "emitter-output-dir": "cadl-output/@azure-tools/cadl-typescript" generateMetadata: true generateTest: true azureSdkForJs: true packageDetails: - name: "@azure-rest/cognitiveservices-translator" - description: "Microsoft Translator Service" + name: "@azure-rest/ai-translation-text" + description: "Microsoft Translation Text" diff --git a/specification/cognitiveservices/translator/main.cadl b/specification/cognitiveservices/translator/main.cadl index 3d7c2b7f28f4..9641291c25a8 100644 --- a/specification/cognitiveservices/translator/main.cadl +++ b/specification/cognitiveservices/translator/main.cadl @@ -1,7 +1,7 @@ import "@cadl-lang/rest"; import "@cadl-lang/versioning"; import "@azure-tools/cadl-azure-core"; -import "./text-translation/routes.cadl"; +import "./routes.cadl"; using Cadl.Rest; using Cadl.Http; @@ -41,9 +41,9 @@ Dictionary lookup. Returns equivalent words for the source term in the target la Dictionary example Returns grammatical structure and context examples for the source term and target term pair. """) @versioned(APIVersion) -namespace Translator; +namespace TextTranslation; -@doc("Translatpr supported versions") +@doc("Text Translation supported versions") enum APIVersion { v3_0: "3.0", } diff --git a/specification/cognitiveservices/translator/text-translation/models-breaksentence.cadl b/specification/cognitiveservices/translator/models-breaksentence.cadl similarity index 97% rename from specification/cognitiveservices/translator/text-translation/models-breaksentence.cadl rename to specification/cognitiveservices/translator/models-breaksentence.cadl index eb2261c3e5ee..3a911f58d2fe 100644 --- a/specification/cognitiveservices/translator/text-translation/models-breaksentence.cadl +++ b/specification/cognitiveservices/translator/models-breaksentence.cadl @@ -7,7 +7,7 @@ using Cadl.Http; using Cadl.Rest; using Azure.Core; -namespace Translator.TextTranslation; +namespace TextTranslation; @doc("Request parameters for the break sentence API.") model BreakSentenceParameters { diff --git a/specification/cognitiveservices/translator/text-translation/models-dictionary.cadl b/specification/cognitiveservices/translator/models-dictionary.cadl similarity index 99% rename from specification/cognitiveservices/translator/text-translation/models-dictionary.cadl rename to specification/cognitiveservices/translator/models-dictionary.cadl index 8e2cd18134b6..5801f6a69c66 100644 --- a/specification/cognitiveservices/translator/text-translation/models-dictionary.cadl +++ b/specification/cognitiveservices/translator/models-dictionary.cadl @@ -6,7 +6,7 @@ using Cadl.Http; using Cadl.Rest; using Azure.Core; -namespace Translator.TextTranslation; +namespace TextTranslation; alias DictionaryBaseParameters = { ...CommonParameters; diff --git a/specification/cognitiveservices/translator/text-translation/models-languages.cadl b/specification/cognitiveservices/translator/models-languages.cadl similarity index 99% rename from specification/cognitiveservices/translator/text-translation/models-languages.cadl rename to specification/cognitiveservices/translator/models-languages.cadl index 53da21c9511c..af782c804306 100644 --- a/specification/cognitiveservices/translator/text-translation/models-languages.cadl +++ b/specification/cognitiveservices/translator/models-languages.cadl @@ -6,7 +6,7 @@ using Cadl.Http; using Cadl.Rest; using Azure.Core; -namespace Translator.TextTranslation; +namespace TextTranslation; @doc("Request parameters for the language API.") model GetLanguageParameters { diff --git a/specification/cognitiveservices/translator/text-translation/models-shared.cadl b/specification/cognitiveservices/translator/models-shared.cadl similarity index 94% rename from specification/cognitiveservices/translator/text-translation/models-shared.cadl rename to specification/cognitiveservices/translator/models-shared.cadl index 7005a49ea6b3..c1a38a23d8ff 100644 --- a/specification/cognitiveservices/translator/text-translation/models-shared.cadl +++ b/specification/cognitiveservices/translator/models-shared.cadl @@ -5,7 +5,7 @@ using Cadl.Http; using Cadl.Rest; using Azure.Core; -namespace Translator.TextTranslation; +namespace TextTranslation; alias CommonParameters = { @header("X-ClientTraceId") @@ -31,7 +31,7 @@ alias CommonResultHeaders = { @doc("Representation of the Error Response from Translator Service.") @error -model MtErrorResponse { +model ErrorResponse { ...CommonResultHeaders; @doc("Error details.") diff --git a/specification/cognitiveservices/translator/text-translation/models-translate.cadl b/specification/cognitiveservices/translator/models-translate.cadl similarity index 99% rename from specification/cognitiveservices/translator/text-translation/models-translate.cadl rename to specification/cognitiveservices/translator/models-translate.cadl index d3203168b8e2..fb92579dc055 100644 --- a/specification/cognitiveservices/translator/text-translation/models-translate.cadl +++ b/specification/cognitiveservices/translator/models-translate.cadl @@ -6,7 +6,7 @@ using Cadl.Http; using Cadl.Rest; using Azure.Core; -namespace Translator.TextTranslation; +namespace TextTranslation; @doc("Request parameters for the translate API.") model TranslateParameters { @@ -149,7 +149,7 @@ enum TextTypes { @fixed @doc("Translator profanity actions") -enum ProfanityActions { +enum ProfanityAction { NoAction, Marked, Deleted @@ -157,7 +157,7 @@ enum ProfanityActions { @fixed @doc("Translator profanity markers") -enum ProfanityMarkers { +enum ProfanityMarker { Asterisk, Tag } diff --git a/specification/cognitiveservices/translator/text-translation/models-transliterate.cadl b/specification/cognitiveservices/translator/models-transliterate.cadl similarity index 97% rename from specification/cognitiveservices/translator/text-translation/models-transliterate.cadl rename to specification/cognitiveservices/translator/models-transliterate.cadl index f344779284d5..13e739d13bd8 100644 --- a/specification/cognitiveservices/translator/text-translation/models-transliterate.cadl +++ b/specification/cognitiveservices/translator/models-transliterate.cadl @@ -6,7 +6,7 @@ using Cadl.Http; using Cadl.Rest; using Azure.Core; -namespace Translator.TextTranslation; +namespace TextTranslation; @doc("Request parameters for the transliterate API.") model TransliterateParameters { diff --git a/specification/cognitiveservices/translator/text-translation/routes.cadl b/specification/cognitiveservices/translator/routes.cadl similarity index 57% rename from specification/cognitiveservices/translator/text-translation/routes.cadl rename to specification/cognitiveservices/translator/routes.cadl index 26fe9cb4e8e5..7d3207849606 100644 --- a/specification/cognitiveservices/translator/text-translation/routes.cadl +++ b/specification/cognitiveservices/translator/routes.cadl @@ -10,9 +10,9 @@ using Azure.Core; using Cadl.Rest; using Cadl.Http; -namespace Translator.TextTranslation; +namespace TextTranslation; -op CustomOperation( +op CustomOperation( ...TParams, @query("api-version") apiVersion: string): TResponse | TError; @@ -21,34 +21,34 @@ op CustomOperation( @route("languages") @summary("Gets the set of languages currently supported by other operations of the Translator.") @doc("Gets the set of languages currently supported by other operations of the Translator.") -op GetLanguages is CustomOperation; +op GetLanguages is CustomOperation; @post @route("translate") @summary("Translate Text") @doc("Translate Text") -op Translate is CustomOperation; +op Translate is CustomOperation; @post @route("transliterate") @summary("Transliterate Text") @doc("Transliterate Text") -op Transliterate is CustomOperation; +op Transliterate is CustomOperation; @post @route("breaksentence") -@summary("Break Sentence") -@doc("Break Sentence") -op BreakSentence is CustomOperation; +@summary("Find Sentence Boundaries") +@doc("Find Sentence Boundaries") +op FindSentenceBoundaries is CustomOperation; @post @route("dictionary/lookup") -@summary("Dictionary Lookup") -@doc("Dictionary Lookup") -op DictionaryLookup is CustomOperation; +@summary("Lookup Dictionary Entries") +@doc("Lookup Dictionary Entries") +op LookupDictionaryEntries is CustomOperation; @post @route("dictionary/examples") -@summary("Dictionary Examples") -@doc("Dictionary Examples") -op DictionaryExamples is CustomOperation; +@summary("Lookup Dictionary Examples") +@doc("Lookup Dictionary Examples") +op LookupDictionaryExamples is CustomOperation; From 58fdb0cc545d5415fad7973d5085bb02a47af064 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Wed, 15 Mar 2023 14:06:27 -0700 Subject: [PATCH 03/27] Update model names --- .../translator/models-breaksentence.cadl | 6 +++--- .../translator/models-dictionary.cadl | 18 +++++++++--------- .../translator/models-shared.cadl | 2 +- .../translator/models-translate.cadl | 18 +++++++++--------- .../translator/models-transliterate.cadl | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/specification/cognitiveservices/translator/models-breaksentence.cadl b/specification/cognitiveservices/translator/models-breaksentence.cadl index 3a911f58d2fe..816eb62dd337 100644 --- a/specification/cognitiveservices/translator/models-breaksentence.cadl +++ b/specification/cognitiveservices/translator/models-breaksentence.cadl @@ -29,7 +29,7 @@ model BreakSentenceParameters { @body @doc("Array of the text for which values the sentence boundaries will be calculated.") - content: InputTextElement[]; + content: InputTextItem[]; } @doc("Response for the Break SEntence API.") @@ -38,11 +38,11 @@ model BreakSentenceResult { @body @doc("Array of the break sentence elements.") - result: BreakSentenceElement[]; + result: BreakSentenceItem[]; } @doc("Elemented containing break sentence result.") -model BreakSentenceElement { +model BreakSentenceItem { @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") detectedLanguage?: DetectedLanguage; diff --git a/specification/cognitiveservices/translator/models-dictionary.cadl b/specification/cognitiveservices/translator/models-dictionary.cadl index 5801f6a69c66..6e856b326b92 100644 --- a/specification/cognitiveservices/translator/models-dictionary.cadl +++ b/specification/cognitiveservices/translator/models-dictionary.cadl @@ -32,7 +32,7 @@ model DictionaryLookupParamters { @body @doc("Array of the text to be sent to dictionary.") - content: InputTextElement[]; + content: InputTextItem[]; } @doc("Request paramters for the dictionary examples API.") @@ -41,7 +41,7 @@ model DictionaryExamplesParamters { @body @doc("Array of the text to be sent to dictionary.") - content: DictionaryExampleTextElement[]; + content: DictionaryExampleTextItem[]; } @doc("Response for the dictionary lookup API.") @@ -50,7 +50,7 @@ model DictionaryLookupResult { @body @doc("Array of the dictionary lookup elements.") - result: DictionaryLookupElement[]; + result: DictionaryLookupItem[]; } @doc("Response for the dictionary examples API.") @@ -59,11 +59,11 @@ model DictionaryExamplesResult { @body @doc("Array of the dictionary examples elements.") - result: DictionaryExampleElement[]; + result: DictionaryExampleItem[]; } @doc("Element containing the text with translation.") -model DictionaryExampleTextElement extends InputTextElement { +model DictionaryExampleTextItem extends InputTextItem { @doc(""" A string specifying the translated text previously returned by the Dictionary lookup operation. This should be the value from the normalizedTarget field in the translations list of the Dictionary @@ -73,7 +73,7 @@ model DictionaryExampleTextElement extends InputTextElement { } @doc("Dictionary Lookup Element") -model DictionaryLookupElement { +model DictionaryLookupItem { @doc(""" A string giving the normalized form of the source term. For example, if the request is "JOHN", the normalized form will be "john". @@ -173,7 +173,7 @@ model BackTranslation { } @doc("Dictionary Example element") -model DictionaryExampleElement { +model DictionaryExampleItem { @doc(""" A string giving the normalized form of the source term. Generally, this should be identical to the value of the Text field at the matching list index in the body of the request. @@ -189,11 +189,11 @@ model DictionaryExampleElement { @doc(""" A list of examples for the (source term, target term) pair. """) - examples: Example[]; + examples: DictionaryExample[]; } @doc("Dictionary Example") -model Example { +model DictionaryExample { @doc(""" The string to concatenate before the value of sourceTerm to form a complete example. Do not add a space character, since it is already there when it should be. diff --git a/specification/cognitiveservices/translator/models-shared.cadl b/specification/cognitiveservices/translator/models-shared.cadl index c1a38a23d8ff..5caf8a038081 100644 --- a/specification/cognitiveservices/translator/models-shared.cadl +++ b/specification/cognitiveservices/translator/models-shared.cadl @@ -16,7 +16,7 @@ alias CommonParameters = { }; @doc("Element containing the text for translation.") -model InputTextElement { +model InputTextItem { @doc("Text to translate.") text: string; } diff --git a/specification/cognitiveservices/translator/models-translate.cadl b/specification/cognitiveservices/translator/models-translate.cadl index fb92579dc055..1f5ec97e0b69 100644 --- a/specification/cognitiveservices/translator/models-translate.cadl +++ b/specification/cognitiveservices/translator/models-translate.cadl @@ -37,7 +37,7 @@ model TranslateParameters { Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html. """) - textType?: TextTypes = TextTypes.plain; + textType?: TextType = TextType.plain; @query @doc(""" @@ -52,14 +52,14 @@ model TranslateParameters { Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked or Deleted. """) - profanityAction?: ProfanityActions = ProfanityActions.NoAction; + profanityAction?: ProfanityAction = ProfanityAction.NoAction; @query @doc(""" Specifies how profanities should be marked in translations. Possible values are: Asterisk (default) or Tag. """) - profanityMarker?: ProfanityMarkers = ProfanityMarkers.Asterisk; + profanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; @query @doc(""" @@ -110,7 +110,7 @@ model TranslateParameters { @body @doc("Array of the text to be translated.") - content: InputTextElement[]; + content: InputTextItem[]; } @doc("Response for the translation API.") @@ -119,7 +119,7 @@ model TranslationResult { @body @doc("Array of the translated text elements.") - result: TranslatedTextElement[]; + result: TranslatedTextItem[]; @header("x-mt-system") @doc(""" @@ -142,7 +142,7 @@ model TranslationResult { @fixed @doc("Translation text type") -enum TextTypes { +enum TextType { plain, html } @@ -163,7 +163,7 @@ enum ProfanityMarker { } @doc("Element containing the translated text") -model TranslatedTextElement { +model TranslatedTextItem { @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") detectedLanguage?: DetectedLanguage; @@ -210,7 +210,7 @@ model Translation { @doc(""" Alignment information. """) - alignment?: Alignment; + alignment?: TranslatedTextAlignment; @doc(""" Sentence boundaries in the input and output texts. @@ -228,7 +228,7 @@ model Transliteration { } @doc("Alignment information object.") -model Alignment { +model TranslatedTextAlignment { @doc(""" Maps input text to translated text. The alignment information is only provided when the request parameter includeAlignment is true. Alignment is returned as a string value of the following diff --git a/specification/cognitiveservices/translator/models-transliterate.cadl b/specification/cognitiveservices/translator/models-transliterate.cadl index 13e739d13bd8..26e42999d6c0 100644 --- a/specification/cognitiveservices/translator/models-transliterate.cadl +++ b/specification/cognitiveservices/translator/models-transliterate.cadl @@ -36,7 +36,7 @@ model TransliterateParameters { @body @doc("Array of the text to be transliterated.") - content: InputTextElement[]; + content: InputTextItem[]; } @doc("Response for the transliteration API.") From 764c7f73a3bf11ee818969dd6c83729f5128cfa6 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Thu, 16 Mar 2023 11:34:22 -0700 Subject: [PATCH 04/27] Move files --- .../translator => translation/text}/cadl-project.yaml | 0 .../text}/examples/3.0/BreakSentence.json | 0 .../text}/examples/3.0/DictionaryExamples.json | 0 .../text}/examples/3.0/DictionaryLookup.json | 0 .../text}/examples/3.0/GetLanguages.json | 0 .../text}/examples/3.0/Translate.json | 0 .../text}/examples/3.0/Transliterate.json | 0 .../translator => translation/text}/main.cadl | 0 .../text}/models-breaksentence.cadl | 0 .../translator => translation/text}/models-dictionary.cadl | 0 .../translator => translation/text}/models-languages.cadl | 0 .../translator => translation/text}/models-shared.cadl | 0 .../translator => translation/text}/models-translate.cadl | 0 .../text}/models-transliterate.cadl | 0 .../translator => translation/text}/package.json | 6 +++--- .../translator => translation/text}/routes.cadl | 0 16 files changed, 3 insertions(+), 3 deletions(-) rename specification/{cognitiveservices/translator => translation/text}/cadl-project.yaml (100%) rename specification/{cognitiveservices/translator => translation/text}/examples/3.0/BreakSentence.json (100%) rename specification/{cognitiveservices/translator => translation/text}/examples/3.0/DictionaryExamples.json (100%) rename specification/{cognitiveservices/translator => translation/text}/examples/3.0/DictionaryLookup.json (100%) rename specification/{cognitiveservices/translator => translation/text}/examples/3.0/GetLanguages.json (100%) rename specification/{cognitiveservices/translator => translation/text}/examples/3.0/Translate.json (100%) rename specification/{cognitiveservices/translator => translation/text}/examples/3.0/Transliterate.json (100%) rename specification/{cognitiveservices/translator => translation/text}/main.cadl (100%) rename specification/{cognitiveservices/translator => translation/text}/models-breaksentence.cadl (100%) rename specification/{cognitiveservices/translator => translation/text}/models-dictionary.cadl (100%) rename specification/{cognitiveservices/translator => translation/text}/models-languages.cadl (100%) rename specification/{cognitiveservices/translator => translation/text}/models-shared.cadl (100%) rename specification/{cognitiveservices/translator => translation/text}/models-translate.cadl (100%) rename specification/{cognitiveservices/translator => translation/text}/models-transliterate.cadl (100%) rename specification/{cognitiveservices/translator => translation/text}/package.json (89%) rename specification/{cognitiveservices/translator => translation/text}/routes.cadl (100%) diff --git a/specification/cognitiveservices/translator/cadl-project.yaml b/specification/translation/text/cadl-project.yaml similarity index 100% rename from specification/cognitiveservices/translator/cadl-project.yaml rename to specification/translation/text/cadl-project.yaml diff --git a/specification/cognitiveservices/translator/examples/3.0/BreakSentence.json b/specification/translation/text/examples/3.0/BreakSentence.json similarity index 100% rename from specification/cognitiveservices/translator/examples/3.0/BreakSentence.json rename to specification/translation/text/examples/3.0/BreakSentence.json diff --git a/specification/cognitiveservices/translator/examples/3.0/DictionaryExamples.json b/specification/translation/text/examples/3.0/DictionaryExamples.json similarity index 100% rename from specification/cognitiveservices/translator/examples/3.0/DictionaryExamples.json rename to specification/translation/text/examples/3.0/DictionaryExamples.json diff --git a/specification/cognitiveservices/translator/examples/3.0/DictionaryLookup.json b/specification/translation/text/examples/3.0/DictionaryLookup.json similarity index 100% rename from specification/cognitiveservices/translator/examples/3.0/DictionaryLookup.json rename to specification/translation/text/examples/3.0/DictionaryLookup.json diff --git a/specification/cognitiveservices/translator/examples/3.0/GetLanguages.json b/specification/translation/text/examples/3.0/GetLanguages.json similarity index 100% rename from specification/cognitiveservices/translator/examples/3.0/GetLanguages.json rename to specification/translation/text/examples/3.0/GetLanguages.json diff --git a/specification/cognitiveservices/translator/examples/3.0/Translate.json b/specification/translation/text/examples/3.0/Translate.json similarity index 100% rename from specification/cognitiveservices/translator/examples/3.0/Translate.json rename to specification/translation/text/examples/3.0/Translate.json diff --git a/specification/cognitiveservices/translator/examples/3.0/Transliterate.json b/specification/translation/text/examples/3.0/Transliterate.json similarity index 100% rename from specification/cognitiveservices/translator/examples/3.0/Transliterate.json rename to specification/translation/text/examples/3.0/Transliterate.json diff --git a/specification/cognitiveservices/translator/main.cadl b/specification/translation/text/main.cadl similarity index 100% rename from specification/cognitiveservices/translator/main.cadl rename to specification/translation/text/main.cadl diff --git a/specification/cognitiveservices/translator/models-breaksentence.cadl b/specification/translation/text/models-breaksentence.cadl similarity index 100% rename from specification/cognitiveservices/translator/models-breaksentence.cadl rename to specification/translation/text/models-breaksentence.cadl diff --git a/specification/cognitiveservices/translator/models-dictionary.cadl b/specification/translation/text/models-dictionary.cadl similarity index 100% rename from specification/cognitiveservices/translator/models-dictionary.cadl rename to specification/translation/text/models-dictionary.cadl diff --git a/specification/cognitiveservices/translator/models-languages.cadl b/specification/translation/text/models-languages.cadl similarity index 100% rename from specification/cognitiveservices/translator/models-languages.cadl rename to specification/translation/text/models-languages.cadl diff --git a/specification/cognitiveservices/translator/models-shared.cadl b/specification/translation/text/models-shared.cadl similarity index 100% rename from specification/cognitiveservices/translator/models-shared.cadl rename to specification/translation/text/models-shared.cadl diff --git a/specification/cognitiveservices/translator/models-translate.cadl b/specification/translation/text/models-translate.cadl similarity index 100% rename from specification/cognitiveservices/translator/models-translate.cadl rename to specification/translation/text/models-translate.cadl diff --git a/specification/cognitiveservices/translator/models-transliterate.cadl b/specification/translation/text/models-transliterate.cadl similarity index 100% rename from specification/cognitiveservices/translator/models-transliterate.cadl rename to specification/translation/text/models-transliterate.cadl diff --git a/specification/cognitiveservices/translator/package.json b/specification/translation/text/package.json similarity index 89% rename from specification/cognitiveservices/translator/package.json rename to specification/translation/text/package.json index 8ac35d57e0c0..1f533ce87c8e 100644 --- a/specification/cognitiveservices/translator/package.json +++ b/specification/translation/text/package.json @@ -1,5 +1,5 @@ { - "name": "@cadl-api-spec/translator", + "name": "@cadl-api-spec/translation-text", "author": "Microsoft Corporation", "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural machine translation technology to enable quick and accurate source-to-target text translation in real time across all supported languages.", "license": "MIT", @@ -7,10 +7,10 @@ "@azure-tools/cadl-autorest": "latest", "@azure-tools/cadl-azure-core": "latest", "@azure-tools/cadl-csharp": "latest", + "@azure-tools/cadl-dpg": "latest", "@azure-tools/cadl-java": "latest", + "@azure-tools/cadl-python": "0.5.0", "@azure-tools/cadl-typescript": "latest", - "@azure-tools/cadl-dpg": "latest", - "@azure-tools/cadl-python": "latest", "@cadl-lang/compiler": "latest", "@cadl-lang/prettier-plugin-cadl": "latest", "@cadl-lang/rest": "latest", diff --git a/specification/cognitiveservices/translator/routes.cadl b/specification/translation/text/routes.cadl similarity index 100% rename from specification/cognitiveservices/translator/routes.cadl rename to specification/translation/text/routes.cadl From 425fa9023783cd1b30a5ae1cc80149c34191aada Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 17 Mar 2023 11:40:28 -0700 Subject: [PATCH 05/27] Switch to knowValues --- .../translation/text/models-translate.cadl | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/specification/translation/text/models-translate.cadl b/specification/translation/text/models-translate.cadl index 1f5ec97e0b69..38264bc72574 100644 --- a/specification/translation/text/models-translate.cadl +++ b/specification/translation/text/models-translate.cadl @@ -37,7 +37,7 @@ model TranslateParameters { Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html. """) - textType?: TextType = TextType.plain; + textType?: TextType = "Plain"; @query @doc(""" @@ -52,14 +52,14 @@ model TranslateParameters { Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked or Deleted. """) - profanityAction?: ProfanityAction = ProfanityAction.NoAction; + profanityAction?: ProfanityAction = "NoAction"; @query @doc(""" Specifies how profanities should be marked in translations. Possible values are: Asterisk (default) or Tag. """) - profanityMarker?: ProfanityMarker = ProfanityMarker.Asterisk; + profanityMarker?: ProfanityMarker = "Asterisk"; @query @doc(""" @@ -140,27 +140,33 @@ model TranslationResult { meteredUsage: int32; } -@fixed +enum TextTypeKnownValues { + Plain: "plain", + Html: "html", +} + @doc("Translation text type") -enum TextType { - plain, - html +@knownValues(TextTypeKnownValues) +scalar TextType extends string; + +enum ProfanityActionKnownValues { + NoAction: "NoAction", + Marked: "Marked", + Deleted: "Deleted", } -@fixed @doc("Translator profanity actions") -enum ProfanityAction { - NoAction, - Marked, - Deleted +@knownValues(ProfanityActionKnownValues) +scalar ProfanityAction extends string; + +enum ProfanityMarkerKnownValues { + Asterisk: "Asterisk", + Tag: "Tag", } -@fixed @doc("Translator profanity markers") -enum ProfanityMarker { - Asterisk, - Tag -} +@knownValues(ProfanityMarkerKnownValues) +scalar ProfanityMarker extends string; @doc("Element containing the translated text") model TranslatedTextItem { From b6b33ff1a2ece873171ad0b58e87be5219062980 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 17 Mar 2023 15:09:37 -0700 Subject: [PATCH 06/27] Reuse transliteration text models --- specification/translation/text/models-translate.cadl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/specification/translation/text/models-translate.cadl b/specification/translation/text/models-translate.cadl index 38264bc72574..31f2a4b9d069 100644 --- a/specification/translation/text/models-translate.cadl +++ b/specification/translation/text/models-translate.cadl @@ -1,6 +1,7 @@ import "@cadl-lang/rest"; import "@azure-tools/cadl-azure-core"; import "./models-shared.cadl"; +import "./models-transliterate.cadl"; using Cadl.Http; using Cadl.Rest; @@ -211,7 +212,7 @@ model Translation { @doc(""" An object giving the translated text in the script specified by the toScript parameter. """) - transliteration?: Transliteration; + transliteration?: TransliteratedText; @doc(""" Alignment information. @@ -224,15 +225,6 @@ model Translation { sentLen?: SentenceLength; } -@doc("An object giving the translated text in the script specified by the toScript parameter.") -model Transliteration { - @doc("A string specifying the target script.") - script: string; - - @doc("A string giving the translated text in the target script.") - text: string; -} - @doc("Alignment information object.") model TranslatedTextAlignment { @doc(""" From 0f0de365a7125c3d1085ad94677fda264a70c977 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Tue, 21 Mar 2023 21:15:25 -0700 Subject: [PATCH 07/27] Migrate to TSP --- .../translation/text/{main.cadl => main.tsp} | 21 ++- ...sentence.cadl => models-breaksentence.tsp} | 48 ++--- ...-dictionary.cadl => models-dictionary.tsp} | 148 +++++++-------- ...ls-languages.cadl => models-languages.tsp} | 108 +++++------ .../{models-shared.cadl => models-shared.tsp} | 38 ++-- ...ls-translate.cadl => models-translate.tsp} | 178 +++++++++--------- ...literate.cadl => models-transliterate.tsp} | 52 ++--- specification/translation/text/package.json | 21 +-- specification/translation/text/routes.cadl | 54 ------ specification/translation/text/routes.tsp | 86 +++++++++ .../{cadl-project.yaml => tspconfig.yaml} | 19 +- 11 files changed, 399 insertions(+), 374 deletions(-) rename specification/translation/text/{main.cadl => main.tsp} (86%) rename specification/translation/text/{models-breaksentence.cadl => models-breaksentence.tsp} (52%) rename specification/translation/text/{models-dictionary.cadl => models-dictionary.tsp} (78%) rename specification/translation/text/{models-languages.cadl => models-languages.tsp} (55%) rename specification/translation/text/{models-shared.cadl => models-shared.tsp} (53%) rename specification/translation/text/{models-translate.cadl => models-translate.tsp} (75%) rename specification/translation/text/{models-transliterate.cadl => models-transliterate.tsp} (56%) delete mode 100644 specification/translation/text/routes.cadl create mode 100644 specification/translation/text/routes.tsp rename specification/translation/text/{cadl-project.yaml => tspconfig.yaml} (52%) diff --git a/specification/translation/text/main.cadl b/specification/translation/text/main.tsp similarity index 86% rename from specification/translation/text/main.cadl rename to specification/translation/text/main.tsp index 9641291c25a8..5fe00b53c8b5 100644 --- a/specification/translation/text/main.cadl +++ b/specification/translation/text/main.tsp @@ -1,14 +1,16 @@ -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "./routes.cadl"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "./routes.tsp"; -using Cadl.Rest; -using Cadl.Http; +using TypeSpec.Rest; +using TypeSpec.Http; using Azure.Core; -using Cadl.Versioning; +using TypeSpec.Versioning; -@service({title: "Text Translation"}) +@service({ + title: "Text Translation", +}) @server( "{Endpoint}", "Text translation is a cloud-based REST API feature of the Translator service that uses neural machine translation technology to enable quick and accurate source-to-target text translation in real time across all supported languages.", @@ -17,10 +19,9 @@ using Cadl.Versioning; Supported Text Translation endpoints (protocol and hostname, for example: https://api.cognitive.microsofttranslator.com). """) - Endpoint: url + Endpoint: url, } ) - @doc(""" Text translation is a cloud-based REST API feature of the Translator service that uses neural machine translation technology to enable quick and accurate source-to-target text translation diff --git a/specification/translation/text/models-breaksentence.cadl b/specification/translation/text/models-breaksentence.tsp similarity index 52% rename from specification/translation/text/models-breaksentence.cadl rename to specification/translation/text/models-breaksentence.tsp index 816eb62dd337..8ab6af2f0616 100644 --- a/specification/translation/text/models-breaksentence.cadl +++ b/specification/translation/text/models-breaksentence.tsp @@ -1,54 +1,54 @@ -import "@cadl-lang/rest"; -import "@azure-tools/cadl-azure-core"; -import "./models-shared.cadl"; -import "./models-translate.cadl"; +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; +import "./models-shared.tsp"; +import "./models-translate.tsp"; -using Cadl.Http; -using Cadl.Rest; +using TypeSpec.Http; +using TypeSpec.Rest; using Azure.Core; namespace TextTranslation; @doc("Request parameters for the break sentence API.") model BreakSentenceParameters { - ...CommonParameters; + ...CommonParameters; - @query - @doc(""" + @query + @doc(""" Language tag identifying the language of the input text. If a code isn't specified, automatic language detection will be applied. """) - language?: string; + language?: string; - @query - @doc(""" + @query + @doc(""" Script tag identifying the script used by the input text. If a script isn't specified, the default script of the language will be assumed. """) - script?: string; + script?: string; - @body - @doc("Array of the text for which values the sentence boundaries will be calculated.") - content: InputTextItem[]; + @body + @doc("Array of the text for which values the sentence boundaries will be calculated.") + content: InputTextItem[]; } @doc("Response for the Break SEntence API.") model BreakSentenceResult { - ...CommonResultHeaders; + ...CommonResultHeaders; - @body - @doc("Array of the break sentence elements.") - result: BreakSentenceItem[]; + @body + @doc("Array of the break sentence elements.") + result: BreakSentenceItem[]; } @doc("Elemented containing break sentence result.") model BreakSentenceItem { - @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") - detectedLanguage?: DetectedLanguage; + @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") + detectedLanguage?: DetectedLanguage; - @doc(""" + @doc(""" An integer array representing the lengths of the sentences in the input text. The length of the array is the number of sentences, and the values are the length of each sentence. """) - sentLen: int32[]; + sentLen: int32[]; } diff --git a/specification/translation/text/models-dictionary.cadl b/specification/translation/text/models-dictionary.tsp similarity index 78% rename from specification/translation/text/models-dictionary.cadl rename to specification/translation/text/models-dictionary.tsp index 6e856b326b92..395fb1b8c655 100644 --- a/specification/translation/text/models-dictionary.cadl +++ b/specification/translation/text/models-dictionary.tsp @@ -1,160 +1,160 @@ -import "@cadl-lang/rest"; -import "@azure-tools/cadl-azure-core"; -import "./models-shared.cadl"; +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; +import "./models-shared.tsp"; -using Cadl.Http; -using Cadl.Rest; +using TypeSpec.Http; +using TypeSpec.Rest; using Azure.Core; namespace TextTranslation; alias DictionaryBaseParameters = { - ...CommonParameters; + ...CommonParameters; - @query - @doc(""" + @query + @doc(""" Specifies the language of the input text. The source language must be one of the supported languages included in the dictionary scope. """) - from: string; + from: string; - @query - @doc(""" + @query + @doc(""" Specifies the language of the output text. The target language must be one of the supported languages included in the dictionary scope. """) - to: string; + to: string; }; @doc("Request parameters for the dictionary lookup API.") model DictionaryLookupParamters { - ...DictionaryBaseParameters; + ...DictionaryBaseParameters; - @body - @doc("Array of the text to be sent to dictionary.") - content: InputTextItem[]; + @body + @doc("Array of the text to be sent to dictionary.") + content: InputTextItem[]; } @doc("Request paramters for the dictionary examples API.") model DictionaryExamplesParamters { - ...DictionaryBaseParameters; + ...DictionaryBaseParameters; - @body - @doc("Array of the text to be sent to dictionary.") - content: DictionaryExampleTextItem[]; + @body + @doc("Array of the text to be sent to dictionary.") + content: DictionaryExampleTextItem[]; } @doc("Response for the dictionary lookup API.") model DictionaryLookupResult { - ...CommonResultHeaders; + ...CommonResultHeaders; - @body - @doc("Array of the dictionary lookup elements.") - result: DictionaryLookupItem[]; + @body + @doc("Array of the dictionary lookup elements.") + result: DictionaryLookupItem[]; } @doc("Response for the dictionary examples API.") model DictionaryExamplesResult { - ...CommonResultHeaders; + ...CommonResultHeaders; - @body - @doc("Array of the dictionary examples elements.") - result: DictionaryExampleItem[]; + @body + @doc("Array of the dictionary examples elements.") + result: DictionaryExampleItem[]; } @doc("Element containing the text with translation.") model DictionaryExampleTextItem extends InputTextItem { - @doc(""" + @doc(""" A string specifying the translated text previously returned by the Dictionary lookup operation. This should be the value from the normalizedTarget field in the translations list of the Dictionary lookup response. The service will return examples for the specific source-target word-pair. """) - translation: string; + translation: string; } @doc("Dictionary Lookup Element") model DictionaryLookupItem { - @doc(""" + @doc(""" A string giving the normalized form of the source term. For example, if the request is "JOHN", the normalized form will be "john". The content of this field becomes the input to lookup examples. """) - normalizedSource: string; + normalizedSource: string; - @doc(""" + @doc(""" A string giving the source term in a form best suited for end-user display. For example, if the input is "JOHN", the display form will reflect the usual spelling of the name: "John". """) - displaySource: string; + displaySource: string; - @doc(""" + @doc(""" A list of translations for the source term. """) - translations: DictionaryTranslation[]; + translations: DictionaryTranslation[]; } @doc("Translation source term.") model DictionaryTranslation { - @doc(""" + @doc(""" A string giving the normalized form of this term in the target language. This value should be used as input to lookup examples. """) - normalizedTarget: string; + normalizedTarget: string; - @doc(""" + @doc(""" A string giving the term in the target language and in a form best suited for end-user display. Generally, this will only differ from the normalizedTarget in terms of capitalization. For example, a proper noun like "Juan" will have normalizedTarget = "juan" and displayTarget = "Juan". """) - displayTarget: string; + displayTarget: string; - @doc(""" + @doc(""" A string associating this term with a part-of-speech tag. """) - posTag: string; + posTag: string; - @doc(""" + @doc(""" A value between 0.0 and 1.0 which represents the "confidence" (or perhaps more accurately, "probability in the training data") of that translation pair. The sum of confidence scores for one source word may or may not sum to 1.0. """) - confidence: float32; + confidence: float32; - @doc(""" + @doc(""" A string giving the word to display as a prefix of the translation. Currently, this is the gendered determiner of nouns, in languages that have gendered determiners. For example, the prefix of the Spanish word "mosca" is "la", since "mosca" is a feminine noun in Spanish. This is only dependent on the translation, and not on the source. If there is no prefix, it will be the empty string. """) - prefixWord: string; + prefixWord: string; - @doc(""" + @doc(""" A list of "back translations" of the target. For example, source words that the target can translate to. The list is guaranteed to contain the source word that was requested (e.g., if the source word being looked up is "fly", then it is guaranteed that "fly" will be in the backTranslations list). However, it is not guaranteed to be in the first position, and often will not be. """) - backTranslations: BackTranslation[]; + backTranslations: BackTranslation[]; } @doc("Back Translation") model BackTranslation { - @doc(""" + @doc(""" A string giving the normalized form of the source term that is a back-translation of the target. This value should be used as input to lookup examples. """) - normalizedText: string; + normalizedText: string; - @doc(""" + @doc(""" A string giving the source term that is a back-translation of the target in a form best suited for end-user display. """) - displayText: string; + displayText: string; - @doc(""" + @doc(""" An integer representing the number of examples that are available for this translation pair. Actual examples must be retrieved with a separate call to lookup examples. The number is mostly intended to facilitate display in a UX. For example, a user interface may add a hyperlink @@ -163,70 +163,70 @@ model BackTranslation { by a call to lookup examples may be less than numExamples, because additional filtering may be applied on the fly to remove "bad" examples. """) - numExamples: int32; + numExamples: int32; - @doc(""" + @doc(""" An integer representing the frequency of this translation pair in the data. The main purpose of this field is to provide a user interface with a means to sort back-translations so the most frequent terms are first. """) - frequencyCount: int32; + frequencyCount: int32; } @doc("Dictionary Example element") model DictionaryExampleItem { - @doc(""" + @doc(""" A string giving the normalized form of the source term. Generally, this should be identical to the value of the Text field at the matching list index in the body of the request. """) - normalizedSource: string; + normalizedSource: string; - @doc(""" + @doc(""" A string giving the normalized form of the target term. Generally, this should be identical to the value of the Translation field at the matching list index in the body of the request. """) - normalizedTarget: string; + normalizedTarget: string; - @doc(""" + @doc(""" A list of examples for the (source term, target term) pair. """) - examples: DictionaryExample[]; + examples: DictionaryExample[]; } @doc("Dictionary Example") model DictionaryExample { - @doc(""" + @doc(""" The string to concatenate before the value of sourceTerm to form a complete example. Do not add a space character, since it is already there when it should be. This value may be an empty string. """) - sourcePrefix: string; + sourcePrefix: string; - @doc(""" + @doc(""" A string equal to the actual term looked up. The string is added with sourcePrefix and sourceSuffix to form the complete example. Its value is separated so it can be marked in a user interface, e.g., by bolding it. """) - sourceTerm: string; + sourceTerm: string; - @doc(""" + @doc(""" The string to concatenate after the value of sourceTerm to form a complete example. Do not add a space character, since it is already there when it should be. This value may be an empty string. """) - sourceSuffix: string; + sourceSuffix: string; - @doc(""" + @doc(""" A string similar to sourcePrefix but for the target. """) - targetPrefix: string; + targetPrefix: string; - @doc(""" + @doc(""" A string similar to sourceTerm but for the target. """) - targetTerm: string; + targetTerm: string; - @doc(""" + @doc(""" A string similar to sourceSuffix but for the target. """) - targetSuffix: string; + targetSuffix: string; } diff --git a/specification/translation/text/models-languages.cadl b/specification/translation/text/models-languages.tsp similarity index 55% rename from specification/translation/text/models-languages.cadl rename to specification/translation/text/models-languages.tsp index af782c804306..ff0f3b01d131 100644 --- a/specification/translation/text/models-languages.cadl +++ b/specification/translation/text/models-languages.tsp @@ -1,29 +1,29 @@ -import "@cadl-lang/rest"; -import "@azure-tools/cadl-azure-core"; -import "./models-shared.cadl"; +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; +import "./models-shared.tsp"; -using Cadl.Http; -using Cadl.Rest; +using TypeSpec.Http; +using TypeSpec.Rest; using Azure.Core; namespace TextTranslation; @doc("Request parameters for the language API.") model GetLanguageParameters { - ...CommonParameters; + ...CommonParameters; - @query - @doc(""" + @query + @doc(""" A comma-separated list of names defining the group of languages to return. Allowed group names are: `translation`, `transliteration` and `dictionary`. If no scope is given, then all groups are returned, which is equivalent to passing `scope=translation,transliteration,dictionary`. To decide which set of supported languages is appropriate for your scenario, see the description of the [response object](#response-body). """) - scope?: string; + scope?: string; - @header("Accept-Language") - @doc(""" + @header("Accept-Language") + @doc(""" The language to use for user interface strings. Some of the fields in the response are names of languages or names of regions. Use this parameter to define the language in which these names are returned. The language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr` @@ -31,44 +31,44 @@ model GetLanguageParameters { Names are provided in the English language when a target language is not specified or when localization is not available. """) - acceptLanguage?: string = "en"; + acceptLanguage?: string = "en"; - @header("If-None-Match") - @doc(""" + @header("If-None-Match") + @doc(""" Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response. If the resource has not been modified, the service will return status code 304 and an empty response body. """) - ifNoneMatch?: string; + ifNoneMatch?: string; } @doc("Response for the languages API.") model GetLanguagesResult { - ...CommonResultHeaders; + ...CommonResultHeaders; - @header("ETag") - @doc(""" + @header("ETag") + @doc(""" Current value of the entity tag for the requested groups of supported languages. To make subsequent requests more efficient, the client may send the `ETag` value in an `If-None-Match` header field. """) - etag: string; + etag: string; - @doc("Languages that support translate API.") - translation?: Record; + @doc("Languages that support translate API.") + translation?: Record; - @doc("Languages that support transliteration API.") - transliteration?: Record; + @doc("Languages that support transliteration API.") + transliteration?: Record; - @doc("Languages that support dictionary API.") - dictionary?: Record; + @doc("Languages that support dictionary API.") + dictionary?: Record; } alias CommonLanguageModel = { - @doc("Display name of the language in the locale requested via Accept-Language header.") - name: string; + @doc("Display name of the language in the locale requested via Accept-Language header.") + name: string; - @doc("Display name of the language in the locale native for this language.") - nativeName: string; + @doc("Display name of the language in the locale native for this language.") + nativeName: string; }; @doc(""" @@ -76,10 +76,10 @@ The value of the translation property is a dictionary of (key, value) pairs. Eac A key identifies a language for which text can be translated to or translated from. """) model TranslationLanguage { - ...CommonLanguageModel; + ...CommonLanguageModel; - @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") - dir: string; + @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") + dir: string; } @doc(""" @@ -88,52 +88,52 @@ Each key is a BCP 47 language tag. A key identifies a language for which text ca to another script. """) model TransliterationLanguage { - ...CommonLanguageModel; + ...CommonLanguageModel; - @doc("List of scripts to convert from.") - scripts: TransliterableScript[]; + @doc("List of scripts to convert from.") + scripts: TransliterableScript[]; } @doc("Script definition with list of script into which given script can be translitered.") model TransliterableScript extends CommonScriptModel { - @doc("List of scripts available to convert text to.") - toScripts: CommonScriptModel[]; + @doc("List of scripts available to convert text to.") + toScripts: CommonScriptModel[]; } @doc("Common properties of language script") model CommonScriptModel { - @doc("Code identifying the script.") - code: string; + @doc("Code identifying the script.") + code: string; - @doc("Display name of the script in the locale requested via Accept-Language header.") - name: string; + @doc("Display name of the script in the locale requested via Accept-Language header.") + name: string; - @doc("Display name of the language in the locale native for the language.") - nativeName: string; + @doc("Display name of the language in the locale native for the language.") + nativeName: string; - @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") - dir: string; + @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") + dir: string; } alias CommonDictionaryLanguageModel = { - ...CommonLanguageModel; + ...CommonLanguageModel; - @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") - dir: string; + @doc("Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.") + dir: string; }; @doc("Properties ot the source dictionary language") model SourceDictionaryLanguage { - ...CommonDictionaryLanguageModel; + ...CommonDictionaryLanguageModel; - @doc("List of languages with alterative translations and examples for the query expressed in the source language.") - translations: TargetDictionaryLanguage[]; + @doc("List of languages with alterative translations and examples for the query expressed in the source language.") + translations: TargetDictionaryLanguage[]; } @doc("Properties of the target dictionary language") model TargetDictionaryLanguage { - ...CommonDictionaryLanguageModel; + ...CommonDictionaryLanguageModel; - @doc("Language code identifying the target language.") - code: string; + @doc("Language code identifying the target language.") + code: string; } diff --git a/specification/translation/text/models-shared.cadl b/specification/translation/text/models-shared.tsp similarity index 53% rename from specification/translation/text/models-shared.cadl rename to specification/translation/text/models-shared.tsp index 5caf8a038081..2402d30c67cd 100644 --- a/specification/translation/text/models-shared.cadl +++ b/specification/translation/text/models-shared.tsp @@ -1,48 +1,48 @@ -import "@cadl-lang/rest"; -import "@azure-tools/cadl-azure-core"; +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; -using Cadl.Http; -using Cadl.Rest; +using TypeSpec.Http; +using TypeSpec.Rest; using Azure.Core; namespace TextTranslation; alias CommonParameters = { - @header("X-ClientTraceId") - @doc(""" + @header("X-ClientTraceId") + @doc(""" A client-generated GUID to uniquely identify the request. """) - clientTraceId?: string; + clientTraceId?: string; }; @doc("Element containing the text for translation.") model InputTextItem { - @doc("Text to translate.") - text: string; + @doc("Text to translate.") + text: string; } alias CommonResultHeaders = { - @header("X-RequestId") - @doc(""" + @header("X-RequestId") + @doc(""" Value generated by the service to identify the request. It is used for troubleshooting purposes. """) - requestId: string; + requestId: string; }; @doc("Representation of the Error Response from Translator Service.") @error model ErrorResponse { - ...CommonResultHeaders; + ...CommonResultHeaders; - @doc("Error details.") - error: ErrorDetails; + @doc("Error details.") + error: ErrorDetails; } @doc("Error details as returned by Translator Service.") model ErrorDetails { - @doc("Number indetifier of the error.") - code: int32; + @doc("Number indetifier of the error.") + code: int32; - @doc("Human readable error description.") - message: string; + @doc("Human readable error description.") + message: string; } diff --git a/specification/translation/text/models-translate.cadl b/specification/translation/text/models-translate.tsp similarity index 75% rename from specification/translation/text/models-translate.cadl rename to specification/translation/text/models-translate.tsp index 31f2a4b9d069..c86e7bce10ff 100644 --- a/specification/translation/text/models-translate.cadl +++ b/specification/translation/text/models-translate.tsp @@ -1,29 +1,29 @@ -import "@cadl-lang/rest"; -import "@azure-tools/cadl-azure-core"; -import "./models-shared.cadl"; -import "./models-transliterate.cadl"; +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; +import "./models-shared.tsp"; +import "./models-transliterate.tsp"; -using Cadl.Http; -using Cadl.Rest; +using TypeSpec.Http; +using TypeSpec.Rest; using Azure.Core; namespace TextTranslation; @doc("Request parameters for the translate API.") model TranslateParameters { - ...CommonParameters; + ...CommonParameters; - @query - @doc(""" + @query + @doc(""" Specifies the language of the output text. The target language must be one of the supported languages included in the translation scope. For example, use to=de to translate to German. It's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. For example, use to=de&to=it to translate to German and Italian. """) - to: string[]; + to: string[]; - @query - @doc(""" + @query + @doc(""" Specifies the language of the input text. Find which languages are available to translate from by looking up supported languages using the translation scope. If the from parameter isn't specified, automatic language detection is applied to determine the source language. @@ -31,73 +31,73 @@ model TranslateParameters { You must use the from parameter rather than autodetection when using the dynamic dictionary feature. Note: the dynamic dictionary feature is case-sensitive. """) - from?: string; + from?: string; - @query - @doc(""" + @query + @doc(""" Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html. """) - textType?: TextType = "Plain"; + textType?: TextType = "Plain"; - @query - @doc(""" + @query + @doc(""" A string specifying the category (domain) of the translation. This parameter is used to get translations from a customized system built with Custom Translator. Add the Category ID from your Custom Translator project details to this parameter to use your deployed customized system. Default value is: general. """) - category?: string = "general"; + category?: string = "general"; - @query - @doc(""" + @query + @doc(""" Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked or Deleted. """) - profanityAction?: ProfanityAction = "NoAction"; + profanityAction?: ProfanityAction = "NoAction"; - @query - @doc(""" + @query + @doc(""" Specifies how profanities should be marked in translations. Possible values are: Asterisk (default) or Tag. """) - profanityMarker?: ProfanityMarker = "Asterisk"; + profanityMarker?: ProfanityMarker = "Asterisk"; - @query - @doc(""" + @query + @doc(""" Specifies whether to include alignment projection from source text to translated text. Possible values are: true or false (default). """) - includeAlignment?: boolean = false; + includeAlignment?: boolean = false; - @query - @doc(""" + @query + @doc(""" Specifies whether to include sentence boundaries for the input text and the translated text. Possible values are: true or false (default). """) - includeSentenceLength?: boolean = false; + includeSentenceLength?: boolean = false; - @query - @doc(""" + @query + @doc(""" Specifies a fallback language if the language of the input text can't be identified. Language autodetection is applied when the from parameter is omitted. If detection fails, the suggestedFrom language will be assumed. """) - suggestedFrom?: string; + suggestedFrom?: string; - @query - @doc(""" + @query + @doc(""" Specifies the script of the input text. """) - fromScript?: string; + fromScript?: string; - @query - @doc(""" + @query + @doc(""" Specifies the script of the translated text. """) - toScript?: string; + toScript?: string; - @query - @doc(""" + @query + @doc(""" Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. Possible values are: true (default) or false. @@ -107,38 +107,38 @@ model TranslateParameters { If no system is found with the specific category, the request will return a 400 status code. allowFallback=true specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. """) - allowFallback?: boolean = true; + allowFallback?: boolean = true; - @body - @doc("Array of the text to be translated.") - content: InputTextItem[]; + @body + @doc("Array of the text to be translated.") + content: InputTextItem[]; } @doc("Response for the translation API.") model TranslationResult { - ...CommonResultHeaders; + ...CommonResultHeaders; - @body - @doc("Array of the translated text elements.") - result: TranslatedTextItem[]; + @body + @doc("Array of the translated text elements.") + result: TranslatedTextItem[]; - @header("x-mt-system") - @doc(""" + @header("x-mt-system") + @doc(""" Specifies the system type that was used for translation for each 'to' language requested for translation. The value is a comma-separated list of strings. Each string indicates a type: * Custom - Request includes a custom system and at least one custom system was used during translation. * Team - All other requests """) - mtSystem: string; + mtSystem: string; - @header("x-metered-usage") - @doc(""" + @header("x-metered-usage") + @doc(""" Specifies consumption (the number of characters for which the user will be charged) for the translation job request. For example, if the word "Hello" is translated from English (en) to French (fr), this field will return the value '5'. """) - meteredUsage: int32; + meteredUsage: int32; } enum TextTypeKnownValues { @@ -151,9 +151,9 @@ enum TextTypeKnownValues { scalar TextType extends string; enum ProfanityActionKnownValues { - NoAction: "NoAction", - Marked: "Marked", - Deleted: "Deleted", + NoAction: "NoAction", + Marked: "Marked", + Deleted: "Deleted", } @doc("Translator profanity actions") @@ -161,8 +161,8 @@ enum ProfanityActionKnownValues { scalar ProfanityAction extends string; enum ProfanityMarkerKnownValues { - Asterisk: "Asterisk", - Tag: "Tag", + Asterisk: "Asterisk", + Tag: "Tag", } @doc("Translator profanity markers") @@ -171,63 +171,63 @@ scalar ProfanityMarker extends string; @doc("Element containing the translated text") model TranslatedTextItem { - @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") - detectedLanguage?: DetectedLanguage; + @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") + detectedLanguage?: DetectedLanguage; - @doc(""" + @doc(""" An array of translation results. The size of the array matches the number of target languages specified through the to query parameter. """) - translations: Translation[]; + translations: Translation[]; - @doc(""" + @doc(""" Input text in the default script of the source language. sourceText property is present only when the input is expressed in a script that's not the usual script for the language. For example, if the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text converted into Arab script. """) - sourceText?: SourceText; + sourceText?: SourceText; } @doc("An object describing the detected language.") model DetectedLanguage { - @doc("A string representing the code of the detected language.") - language: string; + @doc("A string representing the code of the detected language.") + language: string; - @doc(""" + @doc(""" A float value indicating the confidence in the result. The score is between zero and one and a low score indicates a low confidence. """) - score: float32; + score: float32; } @doc("Translation result") model Translation { - @doc("A string representing the language code of the target language.") - to: string; + @doc("A string representing the language code of the target language.") + to: string; - @doc("A string giving the translated text.") - text: string; + @doc("A string giving the translated text.") + text: string; - @doc(""" + @doc(""" An object giving the translated text in the script specified by the toScript parameter. """) - transliteration?: TransliteratedText; + transliteration?: TransliteratedText; - @doc(""" + @doc(""" Alignment information. """) - alignment?: TranslatedTextAlignment; + alignment?: TranslatedTextAlignment; - @doc(""" + @doc(""" Sentence boundaries in the input and output texts. """) - sentLen?: SentenceLength; + sentLen?: SentenceLength; } @doc("Alignment information object.") model TranslatedTextAlignment { - @doc(""" + @doc(""" Maps input text to translated text. The alignment information is only provided when the request parameter includeAlignment is true. Alignment is returned as a string value of the following format: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. @@ -235,28 +235,28 @@ model TranslatedTextAlignment { One word may align with zero, one, or multiple words in the other language, and the aligned words may be non-contiguous. When no alignment information is available, the alignment element will be empty. """) - proj: string; + proj: string; } @doc("An object returning sentence boundaries in the input and output texts.") model SentenceLength { - @doc(""" + @doc(""" An integer array representing the lengths of the sentences in the input text. The length of the array is the number of sentences, and the values are the length of each sentence. """) - srcSentLen: int32[]; + srcSentLen: int32[]; - @doc(""" + @doc(""" An integer array representing the lengths of the sentences in the translated text. The length of the array is the number of sentences, and the values are the length of each sentence. """) - transSentLen: int32[]; + transSentLen: int32[]; } @doc("Input text in the default script of the source language. ") model SourceText { - @doc(""" + @doc(""" Input text in the default script of the source language. """) - text: string; + text: string; } diff --git a/specification/translation/text/models-transliterate.cadl b/specification/translation/text/models-transliterate.tsp similarity index 56% rename from specification/translation/text/models-transliterate.cadl rename to specification/translation/text/models-transliterate.tsp index 26e42999d6c0..9d8855beb9c9 100644 --- a/specification/translation/text/models-transliterate.cadl +++ b/specification/translation/text/models-transliterate.tsp @@ -1,58 +1,58 @@ -import "@cadl-lang/rest"; -import "@azure-tools/cadl-azure-core"; -import "./models-shared.cadl"; +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; +import "./models-shared.tsp"; -using Cadl.Http; -using Cadl.Rest; +using TypeSpec.Http; +using TypeSpec.Rest; using Azure.Core; namespace TextTranslation; @doc("Request parameters for the transliterate API.") model TransliterateParameters { - ...CommonParameters; + ...CommonParameters; - @query - @doc(""" + @query + @doc(""" Specifies the language of the text to convert from one script to another. Possible languages are listed in the transliteration scope obtained by querying the service for its supported languages. """) - language: string; + language: string; - @query - @doc(""" + @query + @doc(""" Specifies the script used by the input text. Look up supported languages using the transliteration scope, to find input scripts available for the selected language. """) - fromScript: string; + fromScript: string; - @query - @doc(""" + @query + @doc(""" Specifies the output script. Look up supported languages using the transliteration scope, to find output scripts available for the selected combination of input language and input script. """) - toScript: string; + toScript: string; - @body - @doc("Array of the text to be transliterated.") - content: InputTextItem[]; + @body + @doc("Array of the text to be transliterated.") + content: InputTextItem[]; } @doc("Response for the transliteration API.") model TransliterateResult { - ...CommonResultHeaders; + ...CommonResultHeaders; - @body - @doc("Array of transliterated texts") - result: TransliteratedText[]; + @body + @doc("Array of transliterated texts") + result: TransliteratedText[]; } @doc("Transliterated text element.") model TransliteratedText { - @doc("A string which is the result of converting the input string to the output script.") - text: string; + @doc("A string which is the result of converting the input string to the output script.") + text: string; - @doc("A string specifying the script used in the output.") - script: string; + @doc("A string specifying the script used in the output.") + script: string; } diff --git a/specification/translation/text/package.json b/specification/translation/text/package.json index 1f533ce87c8e..d496bab9bce8 100644 --- a/specification/translation/text/package.json +++ b/specification/translation/text/package.json @@ -4,17 +4,16 @@ "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural machine translation technology to enable quick and accurate source-to-target text translation in real time across all supported languages.", "license": "MIT", "dependencies": { - "@azure-tools/cadl-autorest": "latest", - "@azure-tools/cadl-azure-core": "latest", - "@azure-tools/cadl-csharp": "latest", - "@azure-tools/cadl-dpg": "latest", - "@azure-tools/cadl-java": "latest", - "@azure-tools/cadl-python": "0.5.0", - "@azure-tools/cadl-typescript": "latest", - "@cadl-lang/compiler": "latest", - "@cadl-lang/prettier-plugin-cadl": "latest", - "@cadl-lang/rest": "latest", - "@cadl-lang/versioning": "latest" + "@azure-tools/typespec-apiview": "latest", + "@azure-tools/typespec-autorest": "latest", + "@azure-tools/typespec-azure-core": "latest", + "@azure-tools/typespec-client-generator-core": "latest", + "@azure-tools/typespec-csharp": "latest", + "@azure-tools/typespec-python": "latest", + "@azure-tools/typespec-java": "latest", + "@typespec/compiler": "latest", + "@typespec/rest": "latest", + "@typespec/http": "latest" }, "private": true } diff --git a/specification/translation/text/routes.cadl b/specification/translation/text/routes.cadl deleted file mode 100644 index 7d3207849606..000000000000 --- a/specification/translation/text/routes.cadl +++ /dev/null @@ -1,54 +0,0 @@ -import "@cadl-lang/rest"; -import "@azure-tools/cadl-azure-core"; -import "./models-languages.cadl"; -import "./models-translate.cadl"; -import "./models-transliterate.cadl"; -import "./models-breaksentence.cadl"; -import "./models-dictionary.cadl"; - -using Azure.Core; -using Cadl.Rest; -using Cadl.Http; - -namespace TextTranslation; - -op CustomOperation( - ...TParams, - @query("api-version") - apiVersion: string): TResponse | TError; - -@get -@route("languages") -@summary("Gets the set of languages currently supported by other operations of the Translator.") -@doc("Gets the set of languages currently supported by other operations of the Translator.") -op GetLanguages is CustomOperation; - -@post -@route("translate") -@summary("Translate Text") -@doc("Translate Text") -op Translate is CustomOperation; - -@post -@route("transliterate") -@summary("Transliterate Text") -@doc("Transliterate Text") -op Transliterate is CustomOperation; - -@post -@route("breaksentence") -@summary("Find Sentence Boundaries") -@doc("Find Sentence Boundaries") -op FindSentenceBoundaries is CustomOperation; - -@post -@route("dictionary/lookup") -@summary("Lookup Dictionary Entries") -@doc("Lookup Dictionary Entries") -op LookupDictionaryEntries is CustomOperation; - -@post -@route("dictionary/examples") -@summary("Lookup Dictionary Examples") -@doc("Lookup Dictionary Examples") -op LookupDictionaryExamples is CustomOperation; diff --git a/specification/translation/text/routes.tsp b/specification/translation/text/routes.tsp new file mode 100644 index 000000000000..578139a632f4 --- /dev/null +++ b/specification/translation/text/routes.tsp @@ -0,0 +1,86 @@ +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; +import "./models-languages.tsp"; +import "./models-translate.tsp"; +import "./models-transliterate.tsp"; +import "./models-breaksentence.tsp"; +import "./models-dictionary.tsp"; + +using Azure.Core; +using TypeSpec.Rest; +using TypeSpec.Http; + +namespace TextTranslation; + +op CustomOperation( + ...TParams, + + @query("api-version") + apiVersion: string +): TResponse | TError; + +@get +@route("languages") +@summary("Gets the set of languages currently supported by other operations of the Translator.") +@doc("Gets the set of languages currently supported by other operations of the Translator.") +op GetLanguages is CustomOperation< + GetLanguageParameters, + GetLanguagesResult, + {}, + ErrorResponse +>; + +@post +@route("translate") +@summary("Translate Text") +@doc("Translate Text") +op Translate is CustomOperation< + TranslateParameters, + TranslationResult, + {}, + ErrorResponse +>; + +@post +@route("transliterate") +@summary("Transliterate Text") +@doc("Transliterate Text") +op Transliterate is CustomOperation< + TransliterateParameters, + TransliterateResult, + {}, + ErrorResponse +>; + +@post +@route("breaksentence") +@summary("Find Sentence Boundaries") +@doc("Find Sentence Boundaries") +op FindSentenceBoundaries is CustomOperation< + BreakSentenceParameters, + BreakSentenceResult, + {}, + ErrorResponse +>; + +@post +@route("dictionary/lookup") +@summary("Lookup Dictionary Entries") +@doc("Lookup Dictionary Entries") +op LookupDictionaryEntries is CustomOperation< + DictionaryLookupParamters, + DictionaryLookupResult, + {}, + ErrorResponse +>; + +@post +@route("dictionary/examples") +@summary("Lookup Dictionary Examples") +@doc("Lookup Dictionary Examples") +op LookupDictionaryExamples is CustomOperation< + DictionaryExamplesParamters, + DictionaryExamplesResult, + {}, + ErrorResponse +>; diff --git a/specification/translation/text/cadl-project.yaml b/specification/translation/text/tspconfig.yaml similarity index 52% rename from specification/translation/text/cadl-project.yaml rename to specification/translation/text/tspconfig.yaml index 72c59f19c4e1..fe81506c3de6 100644 --- a/specification/translation/text/cadl-project.yaml +++ b/specification/translation/text/tspconfig.yaml @@ -1,23 +1,16 @@ -emit: [ - "@azure-tools/cadl-csharp", - "@azure-tools/cadl-python", - "@azure-tools/cadl-java", - "@azure-tools/cadl-typescript" -] -options: - "@azure-tools/cadl-csharp": +emitters: + "@azure-tools/typespec-csharp": clear-output-folder: true namespace: Azure.AI.Translation.Text model-namespace: false - "@azure-tools/cadl-python": + "@azure-tools/typespec-python": "basic-setup-py": true "package-version": 1.0.0b1 "package-name": azure-ai-translation-text - "@azure-tools/cadl-java": - "emitter-output-dir": "cadl-output/@azure-tools/cadl-java" + "@azure-tools/typespec-java": + partial-update: true namespace: com.azure.ai.translation.text - "@azure-tools/cadl-typescript": - "emitter-output-dir": "cadl-output/@azure-tools/cadl-typescript" + "@azure-tools/typespec-typescript": generateMetadata: true generateTest: true azureSdkForJs: true From 6280b08c1f893e4de9db5f82be4c023fece0cfdf Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Thu, 23 Mar 2023 09:18:11 -0700 Subject: [PATCH 08/27] Updating TS files to satisfy pipeline --- .../text/examples/3.0/BreakSentence.json | 4 +- .../text/examples/3.0/DictionaryExamples.json | 47 +++++----- .../text/examples/3.0/DictionaryLookup.json | 91 +++++++++++++------ .../text/examples/3.0/GetLanguages.json | 68 -------------- .../text/examples/3.0/Translate.json | 4 +- .../text/examples/3.0/Transliterate.json | 4 +- 6 files changed, 98 insertions(+), 120 deletions(-) diff --git a/specification/translation/text/examples/3.0/BreakSentence.json b/specification/translation/text/examples/3.0/BreakSentence.json index e6a1eff5b8e1..109d4a6e39d5 100644 --- a/specification/translation/text/examples/3.0/BreakSentence.json +++ b/specification/translation/text/examples/3.0/BreakSentence.json @@ -6,7 +6,9 @@ "ApiVersion": "v3.0", "Content-Type": "application/json", "body": [ - {"Text":"How are you? I am fine. What did you do today?"} + { + "Text": "How are you? I am fine. What did you do today?" + } ] }, "responses": { diff --git a/specification/translation/text/examples/3.0/DictionaryExamples.json b/specification/translation/text/examples/3.0/DictionaryExamples.json index 84c3136dedf3..28360fce5fd3 100644 --- a/specification/translation/text/examples/3.0/DictionaryExamples.json +++ b/specification/translation/text/examples/3.0/DictionaryExamples.json @@ -8,34 +8,37 @@ "From": "en", "To": "es", "body": [ - {"Text":"fly", "Translation":"volar"} + { + "Text": "fly", + "Translation": "volar" + } ] }, "responses": { "200": [ { - "normalizedSource":"fly", - "normalizedTarget":"volar", - "examples":[ - { - "sourcePrefix":"They need machines to ", - "sourceTerm":"fly", - "sourceSuffix":".", - "targetPrefix":"Necesitan máquinas para ", - "targetTerm":"volar", - "targetSuffix":"." - }, - { - "sourcePrefix":"That should really ", - "sourceTerm":"fly", - "sourceSuffix":".", - "targetPrefix":"Eso realmente debe ", - "targetTerm":"volar", - "targetSuffix":"." - } - ] + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] } - ], + ], "default": { "headers": { "Content-Type": "application/json", diff --git a/specification/translation/text/examples/3.0/DictionaryLookup.json b/specification/translation/text/examples/3.0/DictionaryLookup.json index 0763efe7924e..d527b0cfd886 100644 --- a/specification/translation/text/examples/3.0/DictionaryLookup.json +++ b/specification/translation/text/examples/3.0/DictionaryLookup.json @@ -8,43 +8,80 @@ "From": "en", "To": "es", "body": [ - {"Text":"fly"} + { + "Text": "fly" + } ] }, "responses": { "200": [ { - "normalizedSource":"fly", - "displaySource":"fly", - "translations":[ + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, { - "normalizedTarget":"volar", - "displayTarget":"volar", - "posTag":"VERB", - "confidence":0.4081, - "prefixWord":"", - "backTranslations":[ - {"normalizedText":"fly","displayText":"fly","numExamples":15,"frequencyCount":4637}, - {"normalizedText":"flying","displayText":"flying","numExamples":15,"frequencyCount":1365}, - {"normalizedText":"blow","displayText":"blow","numExamples":15,"frequencyCount":503}, - {"normalizedText":"flight","displayText":"flight","numExamples":15,"frequencyCount":135} - ] + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 }, { - "normalizedTarget":"mosca", - "displayTarget":"mosca", - "posTag":"NOUN", - "confidence":0.2668, - "prefixWord":"", - "backTranslations":[ - {"normalizedText":"fly","displayText":"fly","numExamples":15,"frequencyCount":1697}, - {"normalizedText":"flyweight","displayText":"flyweight","numExamples":0,"frequencyCount":48}, - {"normalizedText":"flies","displayText":"flies","numExamples":9,"frequencyCount":34} - ] + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 } - ] + ] + } + ] } - ], + ], "default": { "headers": { "Content-Type": "application/json", diff --git a/specification/translation/text/examples/3.0/GetLanguages.json b/specification/translation/text/examples/3.0/GetLanguages.json index dd117ee55b0d..a6d1ac627fa8 100644 --- a/specification/translation/text/examples/3.0/GetLanguages.json +++ b/specification/translation/text/examples/3.0/GetLanguages.json @@ -602,40 +602,6 @@ } ] }, - "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": "Belarusian", @@ -704,40 +670,6 @@ } ] }, - "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" - } - ] - } - ] - }, "el": { "name": "Greek", "nativeName": "Ελληνικά", diff --git a/specification/translation/text/examples/3.0/Translate.json b/specification/translation/text/examples/3.0/Translate.json index 97e5c24c533e..a079a1d161d2 100644 --- a/specification/translation/text/examples/3.0/Translate.json +++ b/specification/translation/text/examples/3.0/Translate.json @@ -7,7 +7,9 @@ "Content-Type": "application/json", "To": "cs", "body": [ - {"Text":"This is a test."} + { + "Text": "This is a test." + } ] }, "responses": { diff --git a/specification/translation/text/examples/3.0/Transliterate.json b/specification/translation/text/examples/3.0/Transliterate.json index b4a2617c752b..519773dc34a2 100644 --- a/specification/translation/text/examples/3.0/Transliterate.json +++ b/specification/translation/text/examples/3.0/Transliterate.json @@ -9,7 +9,9 @@ "FromScript": "Hans", "ToScript": "Latn", "body": [ - {"Text":"这是个测试。"} + { + "Text": "这是个测试。" + } ] }, "responses": { From bcac417dad2d3c7e3eb72ad380ae35046ccb0c62 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Thu, 23 Mar 2023 11:04:21 -0700 Subject: [PATCH 09/27] Adding autorest --- specification/translation/text/package.json | 2 ++ specification/translation/text/tspconfig.yaml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/specification/translation/text/package.json b/specification/translation/text/package.json index d496bab9bce8..494e54738f27 100644 --- a/specification/translation/text/package.json +++ b/specification/translation/text/package.json @@ -12,6 +12,8 @@ "@azure-tools/typespec-python": "latest", "@azure-tools/typespec-java": "latest", "@typespec/compiler": "latest", + "@typespec/openapi": "latest", + "@typespec/openapi3": "latest", "@typespec/rest": "latest", "@typespec/http": "latest" }, diff --git a/specification/translation/text/tspconfig.yaml b/specification/translation/text/tspconfig.yaml index fe81506c3de6..c88b8126122b 100644 --- a/specification/translation/text/tspconfig.yaml +++ b/specification/translation/text/tspconfig.yaml @@ -1,4 +1,7 @@ emitters: + "@azure-tools/typespec-autorest": + "output-file": "openapi.json" + "examples-directory": ./examples "@azure-tools/typespec-csharp": clear-output-folder: true namespace: Azure.AI.Translation.Text From f0034534e67753931c057d0c9523799458f8230f Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 24 Mar 2023 13:57:51 -0700 Subject: [PATCH 10/27] Adding swagger file --- .../translation/data-plane/text/readme.md | 55 + .../data-plane/text/stable/v3.0/openapi.json | 1626 +++++++++++++++++ .../translation/text/models-breaksentence.tsp | 2 +- 3 files changed, 1682 insertions(+), 1 deletion(-) create mode 100644 specification/translation/data-plane/text/readme.md create mode 100644 specification/translation/data-plane/text/stable/v3.0/openapi.json diff --git a/specification/translation/data-plane/text/readme.md b/specification/translation/data-plane/text/readme.md new file mode 100644 index 000000000000..d8e67a1158ac --- /dev/null +++ b/specification/translation/data-plane/text/readme.md @@ -0,0 +1,55 @@ +# Cognitive Services Translation Text SDK + +> see https://aka.ms/autorest + +Configuration for generating Translation Text SDK. + +The current release is `release_3_0`. + +``` yaml +tag: release_3_0 +add-credentials: true +openapi-type: data-plane +``` + +# Releases + +### Release 3.0 +These settings apply only when `--tag=release_3_0` is specified on the command line. + +``` yaml $(tag) == 'release_3_0' +input-file: stable/v3.0/openapi.json +``` + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-net-track2 + ``` + +## Multi-API/Profile support for AutoRest v3 generators + +AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. + +This block is updated by an automatic script. Edits may be lost! + +``` yaml $(tag) == 'all-api-versions' /* autogenerated */ +# include the azure profile definitions from the standard location +require: $(this-folder)/../../../../profiles/readme.md + +# all the input files across all versions +input-file: + - $(this-folder)/stable/v3.0/openapi.json +``` + +If there are files that should not be in the `all-api-versions` set, +uncomment the `exclude-file` section below and add the file paths. + +``` yaml $(tag) == 'all-api-versions' +#exclude-file: +# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json +``` diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json new file mode 100644 index 000000000000..b3433b257488 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -0,0 +1,1626 @@ +{ + "swagger": "2.0", + "info": { + "title": "Text Translation", + "version": "3.0", + "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.\n\nDictionary lookup. Returns equivalent words for the source term in the target language.\n\nDictionary example Returns grammatical structure and context examples for the source term and target term pair.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "Endpoint", + "in": "path", + "required": true, + "description": "Supported Text Translation endpoints (protocol and hostname, for example:\n https://api.cognitive.microsofttranslator.com).", + "type": "string", + "format": "uri", + "x-ms-skip-url-encoding": true + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": { + "/breaksentence": { + "post": { + "operationId": "FindSentenceBoundaries", + "summary": "Find Sentence Boundaries", + "description": "Find Sentence Boundaries", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.language" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.script" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.content" + } + ], + "responses": { + "200": { + "description": "Response for the Break SEntence API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "BreakSentenceItem[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/dictionary/examples": { + "post": { + "operationId": "LookupDictionaryExamples", + "summary": "Lookup Dictionary Examples", + "description": "Lookup Dictionary Examples", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "name": "from", + "in": "query", + "required": true, + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", + "type": "string" + }, + { + "name": "to", + "in": "query", + "required": true, + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", + "type": "string" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "$ref": "#/parameters/DictionaryExamplesParamters.content" + } + ], + "responses": { + "200": { + "description": "Response for the dictionary examples API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExampleItem[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/dictionary/lookup": { + "post": { + "operationId": "LookupDictionaryEntries", + "summary": "Lookup Dictionary Entries", + "description": "Lookup Dictionary Entries", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "name": "from", + "in": "query", + "required": true, + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", + "type": "string" + }, + { + "name": "to", + "in": "query", + "required": true, + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", + "type": "string" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "$ref": "#/parameters/DictionaryLookupParamters.content" + } + ], + "responses": { + "200": { + "description": "Response for the dictionary lookup API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryLookupItem[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/languages": { + "get": { + "operationId": "GetLanguages", + "summary": "Gets the set of languages currently supported by other operations of the Translator.", + "description": "Gets the set of languages currently supported by other operations of the Translator.", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "$ref": "#/parameters/GetLanguageParameters.scope" + }, + { + "$ref": "#/parameters/GetLanguageParameters.acceptLanguage" + }, + { + "$ref": "#/parameters/GetLanguageParameters.ifNoneMatch" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "x-ms-client-name": "apiVersion", + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + }, + "ETag": { + "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/GetLanguagesResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/translate": { + "post": { + "operationId": "Translate", + "summary": "Translate Text", + "description": "Translate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "$ref": "#/parameters/TranslateParameters.to" + }, + { + "$ref": "#/parameters/TranslateParameters.from" + }, + { + "$ref": "#/parameters/TranslateParameters.textType" + }, + { + "$ref": "#/parameters/TranslateParameters.category" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityAction" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityMarker" + }, + { + "$ref": "#/parameters/TranslateParameters.includeAlignment" + }, + { + "$ref": "#/parameters/TranslateParameters.includeSentenceLength" + }, + { + "$ref": "#/parameters/TranslateParameters.suggestedFrom" + }, + { + "$ref": "#/parameters/TranslateParameters.fromScript" + }, + { + "$ref": "#/parameters/TranslateParameters.toScript" + }, + { + "$ref": "#/parameters/TranslateParameters.allowFallback" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "$ref": "#/parameters/TranslateParameters.content" + } + ], + "responses": { + "200": { + "description": "Response for the translation API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + }, + "x-mt-system": { + "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests", + "type": "string" + }, + "x-metered-usage": { + "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'.", + "type": "integer", + "format": "int32" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TranslatedTextItem[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/transliterate": { + "post": { + "operationId": "Transliterate", + "summary": "Transliterate Text", + "description": "Transliterate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "$ref": "#/parameters/TransliterateParameters.language" + }, + { + "$ref": "#/parameters/TransliterateParameters.fromScript" + }, + { + "$ref": "#/parameters/TransliterateParameters.toScript" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "$ref": "#/parameters/TransliterateParameters.content" + } + ], + "responses": { + "200": { + "description": "Response for the transliteration API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TransliteratedText" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TransliteratedText[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "APIVersion": { + "type": "string", + "description": "Text Translation supported versions", + "enum": [ + "3.0" + ], + "x-ms-enum": { + "name": "APIVersion", + "modelAsString": true, + "values": [ + { + "name": "v3_0", + "value": "3.0" + } + ] + } + }, + "BackTranslation": { + "type": "object", + "properties": { + "normalizedText": { + "type": "string", + "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." + }, + "displayText": { + "type": "string", + "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." + }, + "numExamples": { + "type": "integer", + "format": "int32", + "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." + }, + "frequencyCount": { + "type": "integer", + "format": "int32", + "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." + } + }, + "description": "Back Translation", + "required": [ + "normalizedText", + "displayText", + "numExamples", + "frequencyCount" + ] + }, + "BreakSentenceItem": { + "type": "object", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "sentLen": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "x-typespec-name": "int32[]", + "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence." + } + }, + "description": "Item containing break sentence result.", + "required": [ + "sentLen" + ] + }, + "BreakSentenceResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "BreakSentenceItem[]", + "description": "Array of the break sentence elements." + } + }, + "description": "Response for the Break SEntence API.", + "required": [ + "result" + ] + }, + "CommonScriptModel": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Code identifying the script." + }, + "name": { + "type": "string", + "description": "Display name of the script in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for the language." + }, + "dir": { + "type": "string", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + } + }, + "description": "Common properties of language script", + "required": [ + "code", + "name", + "nativeName", + "dir" + ] + }, + "DetectedLanguage": { + "type": "object", + "properties": { + "language": { + "type": "string", + "description": "A string representing the code of the detected language." + }, + "score": { + "type": "number", + "format": "float", + "description": "A float value indicating the confidence in the result.\nThe score is between zero and one and a low score indicates a low confidence." + } + }, + "description": "An object describing the detected language.", + "required": [ + "language", + "score" + ] + }, + "DictionaryExample": { + "type": "object", + "properties": { + "sourcePrefix": { + "type": "string", + "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "sourceTerm": { + "type": "string", + "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." + }, + "sourceSuffix": { + "type": "string", + "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "targetPrefix": { + "type": "string", + "description": "A string similar to sourcePrefix but for the target." + }, + "targetTerm": { + "type": "string", + "description": "A string similar to sourceTerm but for the target." + }, + "targetSuffix": { + "type": "string", + "description": "A string similar to sourceSuffix but for the target." + } + }, + "description": "Dictionary Example", + "required": [ + "sourcePrefix", + "sourceTerm", + "sourceSuffix", + "targetPrefix", + "targetTerm", + "targetSuffix" + ] + }, + "DictionaryExampleItem": { + "type": "object", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." + }, + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." + }, + "examples": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExample" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExample[]", + "description": "A list of examples for the (source term, target term) pair." + } + }, + "description": "Dictionary Example element", + "required": [ + "normalizedSource", + "normalizedTarget", + "examples" + ] + }, + "DictionaryExampleTextItem": { + "type": "object", + "properties": { + "translation": { + "type": "string", + "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." + } + }, + "description": "Element containing the text with translation.", + "required": [ + "translation" + ], + "allOf": [ + { + "$ref": "#/definitions/InputTextItem" + } + ] + }, + "DictionaryExamplesResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExampleItem[]", + "description": "Array of the dictionary examples elements." + } + }, + "description": "Response for the dictionary examples API.", + "required": [ + "result" + ] + }, + "DictionaryLookupItem": { + "type": "object", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." + }, + "displaySource": { + "type": "string", + "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." + }, + "translations": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryTranslation" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryTranslation[]", + "description": "A list of translations for the source term." + } + }, + "description": "Dictionary Lookup Element", + "required": [ + "normalizedSource", + "displaySource", + "translations" + ] + }, + "DictionaryLookupResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryLookupItem[]", + "description": "Array of the dictionary lookup elements." + } + }, + "description": "Response for the dictionary lookup API.", + "required": [ + "result" + ] + }, + "DictionaryTranslation": { + "type": "object", + "properties": { + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." + }, + "displayTarget": { + "type": "string", + "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." + }, + "posTag": { + "type": "string", + "description": "A string associating this term with a part-of-speech tag." + }, + "confidence": { + "type": "number", + "format": "float", + "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." + }, + "prefixWord": { + "type": "string", + "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." + }, + "backTranslations": { + "type": "array", + "items": { + "$ref": "#/definitions/BackTranslation" + }, + "x-ms-identifiers": [], + "x-typespec-name": "BackTranslation[]", + "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be." + } + }, + "description": "Translation source term.", + "required": [ + "normalizedTarget", + "displayTarget", + "posTag", + "confidence", + "prefixWord", + "backTranslations" + ] + }, + "ErrorDetails": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "Number indetifier of the error." + }, + "message": { + "type": "string", + "description": "Human readable error description." + } + }, + "description": "Error details as returned by Translator Service.", + "required": [ + "code", + "message" + ] + }, + "ErrorResponse": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDetails", + "description": "Error details." + } + }, + "description": "Representation of the Error Response from Translator Service.", + "required": [ + "error" + ] + }, + "GetLanguagesResult": { + "type": "object", + "properties": { + "translation": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TranslationLanguage" + }, + "x-typespec-name": "Record", + "description": "Languages that support translate API." + }, + "transliteration": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TransliterationLanguage" + }, + "x-typespec-name": "Record", + "description": "Languages that support transliteration API." + }, + "dictionary": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/SourceDictionaryLanguage" + }, + "x-typespec-name": "Record", + "description": "Languages that support dictionary API." + } + }, + "description": "Response for the languages API." + }, + "InputTextItem": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "Text to translate." + } + }, + "description": "Element containing the text for translation.", + "required": [ + "text" + ] + }, + "ProfanityAction": { + "type": "string", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": true, + "values": [ + { + "name": "NoAction", + "value": "NoAction" + }, + { + "name": "Marked", + "value": "Marked" + }, + { + "name": "Deleted", + "value": "Deleted" + } + ] + } + }, + "ProfanityActionKnownValues": { + "type": "string", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityActionKnownValues", + "modelAsString": true, + "values": [ + { + "name": "NoAction", + "value": "NoAction" + }, + { + "name": "Marked", + "value": "Marked" + }, + { + "name": "Deleted", + "value": "Deleted" + } + ] + } + }, + "ProfanityMarker": { + "type": "string", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": true, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk" + }, + { + "name": "Tag", + "value": "Tag" + } + ] + } + }, + "ProfanityMarkerKnownValues": { + "type": "string", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarkerKnownValues", + "modelAsString": true, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk" + }, + { + "name": "Tag", + "value": "Tag" + } + ] + } + }, + "SentenceLength": { + "type": "object", + "properties": { + "srcSentLen": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "x-typespec-name": "int32[]", + "description": "An integer array representing the lengths of the sentences in the input text. \nThe length of the array is the number of sentences, and the values are the length of each sentence." + }, + "transSentLen": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "x-typespec-name": "int32[]", + "description": "An integer array representing the lengths of the sentences in the translated text. \nThe length of the array is the number of sentences, and the values are the length of each sentence." + } + }, + "description": "An object returning sentence boundaries in the input and output texts.", + "required": [ + "srcSentLen", + "transSentLen" + ] + }, + "SourceDictionaryLanguage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "type": "string", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + }, + "translations": { + "type": "array", + "items": { + "$ref": "#/definitions/TargetDictionaryLanguage" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TargetDictionaryLanguage[]", + "description": "List of languages with alterative translations and examples for the query expressed in the source language." + } + }, + "description": "Properties ot the source dictionary language", + "required": [ + "name", + "nativeName", + "dir", + "translations" + ] + }, + "SourceText": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "Input text in the default script of the source language." + } + }, + "description": "Input text in the default script of the source language. ", + "required": [ + "text" + ] + }, + "TargetDictionaryLanguage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "type": "string", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + }, + "code": { + "type": "string", + "description": "Language code identifying the target language." + } + }, + "description": "Properties of the target dictionary language", + "required": [ + "name", + "nativeName", + "dir", + "code" + ] + }, + "TextType": { + "type": "string", + "enum": [ + "plain", + "html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "plain" + }, + { + "name": "Html", + "value": "html" + } + ] + } + }, + "TextTypeKnownValues": { + "type": "string", + "enum": [ + "plain", + "html" + ], + "x-ms-enum": { + "name": "TextTypeKnownValues", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "plain" + }, + { + "name": "Html", + "value": "html" + } + ] + } + }, + "TranslatedTextAlignment": { + "type": "object", + "properties": { + "proj": { + "type": "string", + "description": "Maps input text to translated text. The alignment information is only provided when the request \nparameter includeAlignment is true. Alignment is returned as a string value of the following \nformat: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. \nThe colon separates start and end index, the dash separates the languages, and space separates the words. \nOne word may align with zero, one, or multiple words in the other language, and the aligned words may \nbe non-contiguous. When no alignment information is available, the alignment element will be empty." + } + }, + "description": "Alignment information object.", + "required": [ + "proj" + ] + }, + "TranslatedTextItem": { + "type": "object", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "translations": { + "type": "array", + "items": { + "$ref": "#/definitions/Translation" + }, + "x-ms-identifiers": [], + "x-typespec-name": "Translation[]", + "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter." + }, + "sourceText": { + "$ref": "#/definitions/SourceText", + "description": "Input text in the default script of the source language. sourceText property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text \nconverted into Arab script." + } + }, + "description": "Element containing the translated text", + "required": [ + "translations" + ] + }, + "Translation": { + "type": "object", + "properties": { + "to": { + "type": "string", + "description": "A string representing the language code of the target language." + }, + "text": { + "type": "string", + "description": "A string giving the translated text." + }, + "transliteration": { + "$ref": "#/definitions/TransliteratedText", + "description": "An object giving the translated text in the script specified by the toScript parameter." + }, + "alignment": { + "$ref": "#/definitions/TranslatedTextAlignment", + "description": "Alignment information." + }, + "sentLen": { + "$ref": "#/definitions/SentenceLength", + "description": "Sentence boundaries in the input and output texts." + } + }, + "description": "Translation result", + "required": [ + "to", + "text" + ] + }, + "TranslationLanguage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "type": "string", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + } + }, + "description": "The value of the translation property is a dictionary of (key, value) pairs. Each key is a BCP 47 language tag.\nA key identifies a language for which text can be translated to or translated from.", + "required": [ + "name", + "nativeName", + "dir" + ] + }, + "TranslationResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TranslatedTextItem[]", + "description": "Array of the translated text elements." + } + }, + "description": "Response for the translation API.", + "required": [ + "result" + ] + }, + "TransliterableScript": { + "type": "object", + "properties": { + "toScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/CommonScriptModel" + }, + "x-ms-identifiers": [], + "x-typespec-name": "CommonScriptModel[]", + "description": "List of scripts available to convert text to." + } + }, + "description": "Script definition with list of script into which given script can be translitered.", + "required": [ + "toScripts" + ], + "allOf": [ + { + "$ref": "#/definitions/CommonScriptModel" + } + ] + }, + "TransliterateResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/TransliteratedText" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TransliteratedText[]", + "description": "Array of transliterated texts" + } + }, + "description": "Response for the transliteration API.", + "required": [ + "result" + ] + }, + "TransliteratedText": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "A string which is the result of converting the input string to the output script." + }, + "script": { + "type": "string", + "description": "A string specifying the script used in the output." + } + }, + "description": "Transliterated text element.", + "required": [ + "text", + "script" + ] + }, + "TransliterationLanguage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/TransliterableScript" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TransliterableScript[]", + "description": "List of scripts to convert from." + } + }, + "description": "The value of the transliteration property is a dictionary of (key, value) pairs. \nEach key is a BCP 47 language tag. A key identifies a language for which text can be converted from one script \nto another script.", + "required": [ + "name", + "nativeName", + "scripts" + ] + } + }, + "parameters": { + "BreakSentenceParameters.content": { + "name": "content", + "in": "body", + "required": true, + "description": "Array of the text for which values the sentence boundaries will be calculated.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + }, + "x-ms-parameter-location": "method" + }, + "BreakSentenceParameters.language": { + "name": "language", + "in": "query", + "required": false, + "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "BreakSentenceParameters.script": { + "name": "script", + "in": "query", + "required": false, + "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "DictionaryExamplesParamters.content": { + "name": "content", + "in": "body", + "required": true, + "description": "Array of the text to be sent to dictionary.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExampleTextItem[]" + }, + "x-ms-parameter-location": "method" + }, + "DictionaryLookupParamters.content": { + "name": "content", + "in": "body", + "required": true, + "description": "Array of the text to be sent to dictionary.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + }, + "x-ms-parameter-location": "method" + }, + "GetLanguageParameters.acceptLanguage": { + "name": "Accept-Language", + "in": "header", + "required": false, + "description": "The language to use for user interface strings. Some of the fields in the response are names of languages or \nnames of regions. Use this parameter to define the language in which these names are returned. \nThe language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr` \nto request names in French or use the value `zh-Hant` to request names in Chinese Traditional.\nNames are provided in the English language when a target language is not specified or when localization \nis not available.", + "x-ms-client-name": "acceptLanguage", + "default": "en", + "type": "string", + "x-ms-parameter-location": "method" + }, + "GetLanguageParameters.ifNoneMatch": { + "name": "If-None-Match", + "in": "header", + "required": false, + "description": "Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response. \nIf the resource has not been modified, the service will return status code 304 and an empty response body.", + "x-ms-client-name": "ifNoneMatch", + "type": "string", + "x-ms-parameter-location": "method" + }, + "GetLanguageParameters.scope": { + "name": "scope", + "in": "query", + "required": false, + "description": "A comma-separated list of names defining the group of languages to return.\nAllowed group names are: `translation`, `transliteration` and `dictionary`.\nIf no scope is given, then all groups are returned, which is equivalent to passing \n`scope=translation,transliteration,dictionary`. To decide which set of supported languages \nis appropriate for your scenario, see the description of the [response object](#response-body).", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.allowFallback": { + "name": "allowFallback", + "in": "query", + "required": false, + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", + "default": true, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.category": { + "name": "category", + "in": "query", + "required": false, + "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", + "default": "general", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.content": { + "name": "content", + "in": "body", + "required": true, + "description": "Array of the text to be translated.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.from": { + "name": "from", + "in": "query", + "required": false, + "description": "Specifies the language of the input text. Find which languages are available to translate from by \nlooking up supported languages using the translation scope. If the from parameter isn't specified, \nautomatic language detection is applied to determine the source language.\n\nYou must use the from parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.fromScript": { + "name": "fromScript", + "in": "query", + "required": false, + "description": "Specifies the script of the input text.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.includeAlignment": { + "name": "includeAlignment", + "in": "query", + "required": false, + "description": "Specifies whether to include alignment projection from source text to translated text.\nPossible values are: true or false (default).", + "default": false, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.includeSentenceLength": { + "name": "includeSentenceLength", + "in": "query", + "required": false, + "description": "Specifies whether to include sentence boundaries for the input text and the translated text.\nPossible values are: true or false (default).", + "default": false, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.profanityAction": { + "name": "profanityAction", + "in": "query", + "required": false, + "default": "NoAction", + "type": "string", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": true, + "values": [ + { + "name": "NoAction", + "value": "NoAction" + }, + { + "name": "Marked", + "value": "Marked" + }, + { + "name": "Deleted", + "value": "Deleted" + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.profanityMarker": { + "name": "profanityMarker", + "in": "query", + "required": false, + "default": "Asterisk", + "type": "string", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": true, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk" + }, + { + "name": "Tag", + "value": "Tag" + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.suggestedFrom": { + "name": "suggestedFrom", + "in": "query", + "required": false, + "description": "Specifies a fallback language if the language of the input text can't be identified. \nLanguage autodetection is applied when the from parameter is omitted. If detection fails, \nthe suggestedFrom language will be assumed.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.textType": { + "name": "textType", + "in": "query", + "required": false, + "default": "Plain", + "type": "string", + "enum": [ + "plain", + "html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "plain" + }, + { + "name": "Html", + "value": "html" + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.to": { + "name": "to", + "in": "query", + "required": true, + "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", + "collectionFormat": "multi", + "type": "array", + "items": { + "type": "string" + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.toScript": { + "name": "toScript", + "in": "query", + "required": false, + "description": "Specifies the script of the translated text.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.content": { + "name": "content", + "in": "body", + "required": true, + "description": "Array of the text to be transliterated.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + }, + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.fromScript": { + "name": "fromScript", + "in": "query", + "required": true, + "description": "Specifies the script used by the input text. Look up supported languages using the transliteration scope,\nto find input scripts available for the selected language.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.language": { + "name": "language", + "in": "query", + "required": true, + "description": "Specifies the language of the text to convert from one script to another. \nPossible languages are listed in the transliteration scope obtained by querying the service \nfor its supported languages.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.toScript": { + "name": "toScript", + "in": "query", + "required": true, + "description": "Specifies the output script. Look up supported languages using the transliteration scope, to find output \nscripts available for the selected combination of input language and input script.", + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/translation/text/models-breaksentence.tsp b/specification/translation/text/models-breaksentence.tsp index 8ab6af2f0616..724d6297bdf7 100644 --- a/specification/translation/text/models-breaksentence.tsp +++ b/specification/translation/text/models-breaksentence.tsp @@ -41,7 +41,7 @@ model BreakSentenceResult { result: BreakSentenceItem[]; } -@doc("Elemented containing break sentence result.") +@doc("Item containing break sentence result.") model BreakSentenceItem { @doc("The detectedLanguage property is only present in the result object when language auto-detection is requested.") detectedLanguage?: DetectedLanguage; From 69130904d1c5545b86c16b402bcb26cfe579beaf Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 24 Mar 2023 14:31:27 -0700 Subject: [PATCH 11/27] Adding examples --- .../v3.0/examples/3.0/BreakSentence.json | 41 + .../v3.0/examples/3.0/DictionaryExamples.json | 55 + .../v3.0/examples/3.0/DictionaryLookup.json | 98 + .../v3.0/examples/3.0/GetLanguages.json | 2665 +++++++++++++++++ .../stable/v3.0/examples/3.0/Translate.json | 43 + .../v3.0/examples/3.0/Transliterate.json | 37 + .../data-plane/text/stable/v3.0/openapi.json | 32 +- 7 files changed, 2970 insertions(+), 1 deletion(-) create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryExamples.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryLookup.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/GetLanguages.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/Translate.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/Transliterate.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json new file mode 100644 index 000000000000..109d4a6e39d5 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json @@ -0,0 +1,41 @@ +{ + "operationId": "Translator_TextTranslation_BreakSentence", + "title": "Returns an array of integers representing the length of sentences in a source text.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "body": [ + { + "Text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryExamples.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryExamples.json new file mode 100644 index 000000000000..28360fce5fd3 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryExamples.json @@ -0,0 +1,55 @@ +{ + "operationId": "Translator_TextTranslation_DictionaryExamples", + "title": "Returns alternatives for single word translations.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "From": "en", + "To": "es", + "body": [ + { + "Text": "fly", + "Translation": "volar" + } + ] + }, + "responses": { + "200": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryLookup.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryLookup.json new file mode 100644 index 000000000000..d527b0cfd886 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryLookup.json @@ -0,0 +1,98 @@ +{ + "operationId": "Translator_TextTranslation_DictionaryLookup", + "title": "Returns alternatives for single word translations.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "From": "en", + "To": "es", + "body": [ + { + "Text": "fly" + } + ] + }, + "responses": { + "200": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/GetLanguages.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/GetLanguages.json new file mode 100644 index 000000000000..a6d1ac627fa8 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/GetLanguages.json @@ -0,0 +1,2665 @@ +{ + "operationId": "Translator_TextTranslation_GetLanguages", + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "body": {} + }, + "responses": { + "200": { + "body": { + "translation": { + "af": { + "name": "Afrikaans", + "nativeName": "Afrikaans", + "dir": "ltr" + }, + "am": { + "name": "Amharic", + "nativeName": "አማርኛ", + "dir": "ltr" + }, + "ar": { + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl" + }, + "as": { + "name": "Assamese", + "nativeName": "অসমীয়া", + "dir": "ltr" + }, + "az": { + "name": "Azerbaijani", + "nativeName": "Azərbaycan", + "dir": "ltr" + }, + "ba": { + "name": "Bashkir", + "nativeName": "Bashkir", + "dir": "ltr" + }, + "bg": { + "name": "Bulgarian", + "nativeName": "Български", + "dir": "ltr" + }, + "bn": { + "name": "Bangla", + "nativeName": "বাংলা", + "dir": "ltr" + }, + "bo": { + "name": "Tibetan", + "nativeName": "བོད་སྐད་", + "dir": "ltr" + }, + "bs": { + "name": "Bosnian", + "nativeName": "Bosnian", + "dir": "ltr" + }, + "ca": { + "name": "Catalan", + "nativeName": "Català", + "dir": "ltr" + }, + "cs": { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr" + }, + "cy": { + "name": "Welsh", + "nativeName": "Cymraeg", + "dir": "ltr" + }, + "da": { + "name": "Danish", + "nativeName": "Dansk", + "dir": "ltr" + }, + "de": { + "name": "German", + "nativeName": "Deutsch", + "dir": "ltr" + }, + "dv": { + "name": "Divehi", + "nativeName": "ދިވެހިބަސް", + "dir": "rtl" + }, + "el": { + "name": "Greek", + "nativeName": "Ελληνικά", + "dir": "ltr" + }, + "en": { + "name": "English", + "nativeName": "English", + "dir": "ltr" + }, + "es": { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr" + }, + "et": { + "name": "Estonian", + "nativeName": "Eesti", + "dir": "ltr" + }, + "eu": { + "name": "Basque", + "nativeName": "Euskara", + "dir": "ltr" + }, + "fa": { + "name": "Persian", + "nativeName": "فارسی", + "dir": "rtl" + }, + "fi": { + "name": "Finnish", + "nativeName": "Suomi", + "dir": "ltr" + }, + "fil": { + "name": "Filipino", + "nativeName": "Filipino", + "dir": "ltr" + }, + "fj": { + "name": "Fijian", + "nativeName": "Na Vosa Vakaviti", + "dir": "ltr" + }, + "fo": { + "name": "Faroese", + "nativeName": "Føroyskt", + "dir": "ltr" + }, + "fr": { + "name": "French", + "nativeName": "Français", + "dir": "ltr" + }, + "fr-CA": { + "name": "French (Canada)", + "nativeName": "Français (Canada)", + "dir": "ltr" + }, + "ga": { + "name": "Irish", + "nativeName": "Gaeilge", + "dir": "ltr" + }, + "gl": { + "name": "Galician", + "nativeName": "Galego", + "dir": "ltr" + }, + "gu": { + "name": "Gujarati", + "nativeName": "ગુજરાતી", + "dir": "ltr" + }, + "he": { + "name": "Hebrew", + "nativeName": "עברית", + "dir": "rtl" + }, + "hi": { + "name": "Hindi", + "nativeName": "हिन्दी", + "dir": "ltr" + }, + "hr": { + "name": "Croatian", + "nativeName": "Hrvatski", + "dir": "ltr" + }, + "hsb": { + "name": "Upper Sorbian", + "nativeName": "Hornjoserbšćina", + "dir": "ltr" + }, + "ht": { + "name": "Haitian Creole", + "nativeName": "Haitian Creole", + "dir": "ltr" + }, + "hu": { + "name": "Hungarian", + "nativeName": "Magyar", + "dir": "ltr" + }, + "hy": { + "name": "Armenian", + "nativeName": "Հայերեն", + "dir": "ltr" + }, + "id": { + "name": "Indonesian", + "nativeName": "Indonesia", + "dir": "ltr" + }, + "ikt": { + "name": "Inuinnaqtun", + "nativeName": "Inuinnaqtun", + "dir": "ltr" + }, + "is": { + "name": "Icelandic", + "nativeName": "Íslenska", + "dir": "ltr" + }, + "it": { + "name": "Italian", + "nativeName": "Italiano", + "dir": "ltr" + }, + "iu": { + "name": "Inuktitut", + "nativeName": "ᐃᓄᒃᑎᑐᑦ", + "dir": "ltr" + }, + "iu-Latn": { + "name": "Inuktitut (Latin)", + "nativeName": "Inuktitut (Latin)", + "dir": "ltr" + }, + "ja": { + "name": "Japanese", + "nativeName": "日本語", + "dir": "ltr" + }, + "ka": { + "name": "Georgian", + "nativeName": "ქართული", + "dir": "ltr" + }, + "kk": { + "name": "Kazakh", + "nativeName": "Қазақ Тілі", + "dir": "ltr" + }, + "km": { + "name": "Khmer", + "nativeName": "ខ្មែរ", + "dir": "ltr" + }, + "kmr": { + "name": "Kurdish (Northern)", + "nativeName": "Kurdî (Bakur)", + "dir": "ltr" + }, + "kn": { + "name": "Kannada", + "nativeName": "ಕನ್ನಡ", + "dir": "ltr" + }, + "ko": { + "name": "Korean", + "nativeName": "한국어", + "dir": "ltr" + }, + "ku": { + "name": "Kurdish (Central)", + "nativeName": "Kurdî (Navîn)", + "dir": "rtl" + }, + "ky": { + "name": "Kyrgyz", + "nativeName": "Кыргызча", + "dir": "ltr" + }, + "lo": { + "name": "Lao", + "nativeName": "ລາວ", + "dir": "ltr" + }, + "lt": { + "name": "Lithuanian", + "nativeName": "Lietuvių", + "dir": "ltr" + }, + "lv": { + "name": "Latvian", + "nativeName": "Latviešu", + "dir": "ltr" + }, + "lzh": { + "name": "Chinese (Literary)", + "nativeName": "中文 (文言文)", + "dir": "ltr" + }, + "mg": { + "name": "Malagasy", + "nativeName": "Malagasy", + "dir": "ltr" + }, + "mi": { + "name": "Māori", + "nativeName": "Te Reo Māori", + "dir": "ltr" + }, + "mk": { + "name": "Macedonian", + "nativeName": "Македонски", + "dir": "ltr" + }, + "ml": { + "name": "Malayalam", + "nativeName": "മലയാളം", + "dir": "ltr" + }, + "mn-Cyrl": { + "name": "Mongolian (Cyrillic)", + "nativeName": "Mongolian (Cyrillic)", + "dir": "ltr" + }, + "mn-Mong": { + "name": "Mongolian (Traditional)", + "nativeName": "ᠮᠣᠩᠭᠣᠯ ᠬᠡᠯᠡ", + "dir": "ltr" + }, + "mr": { + "name": "Marathi", + "nativeName": "मराठी", + "dir": "ltr" + }, + "ms": { + "name": "Malay", + "nativeName": "Melayu", + "dir": "ltr" + }, + "mt": { + "name": "Maltese", + "nativeName": "Malti", + "dir": "ltr" + }, + "mww": { + "name": "Hmong Daw", + "nativeName": "Hmong Daw", + "dir": "ltr" + }, + "my": { + "name": "Myanmar (Burmese)", + "nativeName": "မြန်မာ", + "dir": "ltr" + }, + "nb": { + "name": "Norwegian", + "nativeName": "Norsk Bokmål", + "dir": "ltr" + }, + "ne": { + "name": "Nepali", + "nativeName": "नेपाली", + "dir": "ltr" + }, + "nl": { + "name": "Dutch", + "nativeName": "Nederlands", + "dir": "ltr" + }, + "or": { + "name": "Odia", + "nativeName": "ଓଡ଼ିଆ", + "dir": "ltr" + }, + "otq": { + "name": "Querétaro Otomi", + "nativeName": "Hñähñu", + "dir": "ltr" + }, + "pa": { + "name": "Punjabi", + "nativeName": "ਪੰਜਾਬੀ", + "dir": "ltr" + }, + "pl": { + "name": "Polish", + "nativeName": "Polski", + "dir": "ltr" + }, + "prs": { + "name": "Dari", + "nativeName": "دری", + "dir": "rtl" + }, + "ps": { + "name": "Pashto", + "nativeName": "پښتو", + "dir": "rtl" + }, + "pt": { + "name": "Portuguese (Brazil)", + "nativeName": "Português (Brasil)", + "dir": "ltr" + }, + "pt-PT": { + "name": "Portuguese (Portugal)", + "nativeName": "Português (Portugal)", + "dir": "ltr" + }, + "ro": { + "name": "Romanian", + "nativeName": "Română", + "dir": "ltr" + }, + "ru": { + "name": "Russian", + "nativeName": "Русский", + "dir": "ltr" + }, + "sk": { + "name": "Slovak", + "nativeName": "Slovenčina", + "dir": "ltr" + }, + "sl": { + "name": "Slovenian", + "nativeName": "Slovenščina", + "dir": "ltr" + }, + "sm": { + "name": "Samoan", + "nativeName": "Gagana Sāmoa", + "dir": "ltr" + }, + "so": { + "name": "Somali", + "nativeName": "Soomaali", + "dir": "ltr" + }, + "sq": { + "name": "Albanian", + "nativeName": "Shqip", + "dir": "ltr" + }, + "sr-Cyrl": { + "name": "Serbian (Cyrillic)", + "nativeName": "Српски (ћирилица)", + "dir": "ltr" + }, + "sr-Latn": { + "name": "Serbian (Latin)", + "nativeName": "Srpski (latinica)", + "dir": "ltr" + }, + "sv": { + "name": "Swedish", + "nativeName": "Svenska", + "dir": "ltr" + }, + "sw": { + "name": "Swahili", + "nativeName": "Kiswahili", + "dir": "ltr" + }, + "ta": { + "name": "Tamil", + "nativeName": "தமிழ்", + "dir": "ltr" + }, + "te": { + "name": "Telugu", + "nativeName": "తెలుగు", + "dir": "ltr" + }, + "th": { + "name": "Thai", + "nativeName": "ไทย", + "dir": "ltr" + }, + "ti": { + "name": "Tigrinya", + "nativeName": "ትግር", + "dir": "ltr" + }, + "tk": { + "name": "Turkmen", + "nativeName": "Türkmen Dili", + "dir": "ltr" + }, + "tlh-Latn": { + "name": "Klingon (Latin)", + "nativeName": "Klingon (Latin)", + "dir": "ltr" + }, + "tlh-Piqd": { + "name": "Klingon (pIqaD)", + "nativeName": "Klingon (pIqaD)", + "dir": "ltr" + }, + "to": { + "name": "Tongan", + "nativeName": "Lea Fakatonga", + "dir": "ltr" + }, + "tr": { + "name": "Turkish", + "nativeName": "Türkçe", + "dir": "ltr" + }, + "tt": { + "name": "Tatar", + "nativeName": "Татар", + "dir": "ltr" + }, + "ty": { + "name": "Tahitian", + "nativeName": "Reo Tahiti", + "dir": "ltr" + }, + "ug": { + "name": "Uyghur", + "nativeName": "ئۇيغۇرچە", + "dir": "rtl" + }, + "uk": { + "name": "Ukrainian", + "nativeName": "Українська", + "dir": "ltr" + }, + "ur": { + "name": "Urdu", + "nativeName": "اردو", + "dir": "rtl" + }, + "uz": { + "name": "Uzbek (Latin)", + "nativeName": "Uzbek (Latin)", + "dir": "ltr" + }, + "vi": { + "name": "Vietnamese", + "nativeName": "Tiếng Việt", + "dir": "ltr" + }, + "yua": { + "name": "Yucatec Maya", + "nativeName": "Yucatec Maya", + "dir": "ltr" + }, + "yue": { + "name": "Cantonese (Traditional)", + "nativeName": "粵語 (繁體)", + "dir": "ltr" + }, + "zh-Hans": { + "name": "Chinese Simplified", + "nativeName": "中文 (简体)", + "dir": "ltr" + }, + "zh-Hant": { + "name": "Chinese Traditional", + "nativeName": "繁體中文 (繁體)", + "dir": "ltr" + }, + "zu": { + "name": "Zulu", + "nativeName": "Isi-Zulu", + "dir": "ltr" + } + }, + "transliteration": { + "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" + } + ] + } + ] + }, + "be": { + "name": "Belarusian", + "nativeName": "Belarusian", + "scripts": [ + { + "code": "Cyrl", + "name": "Cyrillic", + "nativeName": "Cyrillic", + "dir": "ltr", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr", + "toScripts": [ + { + "code": "Cyrl", + "name": "Cyrillic", + "nativeName": "Cyrillic", + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "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" + } + ] + } + ] + }, + "sd": { + "name": "Sindhi", + "nativeName": "سنڌي", + "scripts": [ + { + "code": "Arab", + "name": "Arabic", + "nativeName": "Arabic", + "dir": "ltr", + "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": "ltr" + } + ] + } + ] + }, + "si": { + "name": "Sinhala", + "nativeName": "සිංහල", + "scripts": [ + { + "code": "Sinh", + "name": "Sinhala", + "nativeName": "Sinhala", + "dir": "ltr", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr", + "toScripts": [ + { + "code": "Sinh", + "name": "Sinhala", + "nativeName": "Sinhala", + "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": "Cyrillic", + "dir": "ltr", + "toScripts": [ + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr" + } + ] + }, + { + "code": "Latn", + "name": "Latin", + "nativeName": "Latin", + "dir": "ltr", + "toScripts": [ + { + "code": "Cyrl", + "name": "Cyrillic", + "nativeName": "Cyrillic", + "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" + } + ] + } + ] + } + }, + "dictionary": { + "af": { + "name": "Afrikaans", + "nativeName": "Afrikaans", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ar": { + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "bg": { + "name": "Bulgarian", + "nativeName": "Български", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "bn": { + "name": "Bangla", + "nativeName": "বাংলা", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "bs": { + "name": "Bosnian", + "nativeName": "Bosnian", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ca": { + "name": "Catalan", + "nativeName": "Català", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "cs": { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "cy": { + "name": "Welsh", + "nativeName": "Cymraeg", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "da": { + "name": "Danish", + "nativeName": "Dansk", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "de": { + "name": "German", + "nativeName": "Deutsch", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "el": { + "name": "Greek", + "nativeName": "Ελληνικά", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "en": { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "translations": [ + { + "name": "Afrikaans", + "nativeName": "Afrikaans", + "dir": "ltr", + "code": "af" + }, + { + "name": "Arabic", + "nativeName": "العربية", + "dir": "rtl", + "code": "ar" + }, + { + "name": "Bulgarian", + "nativeName": "Български", + "dir": "ltr", + "code": "bg" + }, + { + "name": "Bangla", + "nativeName": "বাংলা", + "dir": "ltr", + "code": "bn" + }, + { + "name": "Bosnian", + "nativeName": "Bosnian", + "dir": "ltr", + "code": "bs" + }, + { + "name": "Catalan", + "nativeName": "Català", + "dir": "ltr", + "code": "ca" + }, + { + "name": "Chinese Simplified", + "nativeName": "中文 (简体)", + "dir": "ltr", + "code": "zh-Hans" + }, + { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr", + "code": "cs" + }, + { + "name": "Welsh", + "nativeName": "Cymraeg", + "dir": "ltr", + "code": "cy" + }, + { + "name": "Danish", + "nativeName": "Dansk", + "dir": "ltr", + "code": "da" + }, + { + "name": "German", + "nativeName": "Deutsch", + "dir": "ltr", + "code": "de" + }, + { + "name": "Greek", + "nativeName": "Ελληνικά", + "dir": "ltr", + "code": "el" + }, + { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr", + "code": "es" + }, + { + "name": "Estonian", + "nativeName": "Eesti", + "dir": "ltr", + "code": "et" + }, + { + "name": "Persian", + "nativeName": "فارسی", + "dir": "rtl", + "code": "fa" + }, + { + "name": "Finnish", + "nativeName": "Suomi", + "dir": "ltr", + "code": "fi" + }, + { + "name": "French", + "nativeName": "Français", + "dir": "ltr", + "code": "fr" + }, + { + "name": "Hebrew", + "nativeName": "עברית", + "dir": "rtl", + "code": "he" + }, + { + "name": "Hindi", + "nativeName": "हिन्दी", + "dir": "ltr", + "code": "hi" + }, + { + "name": "Croatian", + "nativeName": "Hrvatski", + "dir": "ltr", + "code": "hr" + }, + { + "name": "Hungarian", + "nativeName": "Magyar", + "dir": "ltr", + "code": "hu" + }, + { + "name": "Indonesian", + "nativeName": "Indonesia", + "dir": "ltr", + "code": "id" + }, + { + "name": "Icelandic", + "nativeName": "Íslenska", + "dir": "ltr", + "code": "is" + }, + { + "name": "Italian", + "nativeName": "Italiano", + "dir": "ltr", + "code": "it" + }, + { + "name": "Japanese", + "nativeName": "日本語", + "dir": "ltr", + "code": "ja" + }, + { + "name": "Korean", + "nativeName": "한국어", + "dir": "ltr", + "code": "ko" + }, + { + "name": "Lithuanian", + "nativeName": "Lietuvių", + "dir": "ltr", + "code": "lt" + }, + { + "name": "Latvian", + "nativeName": "Latviešu", + "dir": "ltr", + "code": "lv" + }, + { + "name": "Maltese", + "nativeName": "Malti", + "dir": "ltr", + "code": "mt" + }, + { + "name": "Malay", + "nativeName": "Melayu", + "dir": "ltr", + "code": "ms" + }, + { + "name": "Hmong Daw", + "nativeName": "Hmong Daw", + "dir": "ltr", + "code": "mww" + }, + { + "name": "Dutch", + "nativeName": "Nederlands", + "dir": "ltr", + "code": "nl" + }, + { + "name": "Norwegian", + "nativeName": "Norsk Bokmål", + "dir": "ltr", + "code": "nb" + }, + { + "name": "Polish", + "nativeName": "Polski", + "dir": "ltr", + "code": "pl" + }, + { + "name": "Portuguese (Brazil)", + "nativeName": "Português (Brasil)", + "dir": "ltr", + "code": "pt" + }, + { + "name": "Romanian", + "nativeName": "Română", + "dir": "ltr", + "code": "ro" + }, + { + "name": "Russian", + "nativeName": "Русский", + "dir": "ltr", + "code": "ru" + }, + { + "name": "Slovak", + "nativeName": "Slovenčina", + "dir": "ltr", + "code": "sk" + }, + { + "name": "Slovenian", + "nativeName": "Slovenščina", + "dir": "ltr", + "code": "sl" + }, + { + "name": "Serbian (Latin)", + "nativeName": "Srpski (latinica)", + "dir": "ltr", + "code": "sr-Latn" + }, + { + "name": "Swedish", + "nativeName": "Svenska", + "dir": "ltr", + "code": "sv" + }, + { + "name": "Swahili", + "nativeName": "Kiswahili", + "dir": "ltr", + "code": "sw" + }, + { + "name": "Tamil", + "nativeName": "தமிழ்", + "dir": "ltr", + "code": "ta" + }, + { + "name": "Thai", + "nativeName": "ไทย", + "dir": "ltr", + "code": "th" + }, + { + "name": "Klingon (Latin)", + "nativeName": "Klingon (Latin)", + "dir": "ltr", + "code": "tlh-Latn" + }, + { + "name": "Turkish", + "nativeName": "Türkçe", + "dir": "ltr", + "code": "tr" + }, + { + "name": "Ukrainian", + "nativeName": "Українська", + "dir": "ltr", + "code": "uk" + }, + { + "name": "Urdu", + "nativeName": "اردو", + "dir": "rtl", + "code": "ur" + }, + { + "name": "Vietnamese", + "nativeName": "Tiếng Việt", + "dir": "ltr", + "code": "vi" + } + ] + }, + "es": { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "et": { + "name": "Estonian", + "nativeName": "Eesti", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "fa": { + "name": "Persian", + "nativeName": "فارسی", + "dir": "rtl", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "fi": { + "name": "Finnish", + "nativeName": "Suomi", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "fr": { + "name": "French", + "nativeName": "Français", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "he": { + "name": "Hebrew", + "nativeName": "עברית", + "dir": "rtl", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "hi": { + "name": "Hindi", + "nativeName": "हिन्दी", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "hr": { + "name": "Croatian", + "nativeName": "Hrvatski", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "hu": { + "name": "Hungarian", + "nativeName": "Magyar", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "id": { + "name": "Indonesian", + "nativeName": "Indonesia", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "is": { + "name": "Icelandic", + "nativeName": "Íslenska", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "it": { + "name": "Italian", + "nativeName": "Italiano", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ja": { + "name": "Japanese", + "nativeName": "日本語", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ko": { + "name": "Korean", + "nativeName": "한국어", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "lt": { + "name": "Lithuanian", + "nativeName": "Lietuvių", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "lv": { + "name": "Latvian", + "nativeName": "Latviešu", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ms": { + "name": "Malay", + "nativeName": "Melayu", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "mt": { + "name": "Maltese", + "nativeName": "Malti", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "mww": { + "name": "Hmong Daw", + "nativeName": "Hmong Daw", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "nb": { + "name": "Norwegian", + "nativeName": "Norsk Bokmål", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "nl": { + "name": "Dutch", + "nativeName": "Nederlands", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "pl": { + "name": "Polish", + "nativeName": "Polski", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "pt": { + "name": "Portuguese (Brazil)", + "nativeName": "Português (Brasil)", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ro": { + "name": "Romanian", + "nativeName": "Română", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ru": { + "name": "Russian", + "nativeName": "Русский", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sk": { + "name": "Slovak", + "nativeName": "Slovenčina", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sl": { + "name": "Slovenian", + "nativeName": "Slovenščina", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sr-Latn": { + "name": "Serbian (Latin)", + "nativeName": "Srpski (latinica)", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sv": { + "name": "Swedish", + "nativeName": "Svenska", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "sw": { + "name": "Swahili", + "nativeName": "Kiswahili", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ta": { + "name": "Tamil", + "nativeName": "தமிழ்", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "th": { + "name": "Thai", + "nativeName": "ไทย", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "tlh-Latn": { + "name": "Klingon (Latin)", + "nativeName": "Klingon (Latin)", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "tr": { + "name": "Turkish", + "nativeName": "Türkçe", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "uk": { + "name": "Ukrainian", + "nativeName": "Українська", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "ur": { + "name": "Urdu", + "nativeName": "اردو", + "dir": "rtl", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "vi": { + "name": "Vietnamese", + "nativeName": "Tiếng Việt", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + }, + "zh-Hans": { + "name": "Chinese Simplified", + "nativeName": "中文 (简体)", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + } + } + } + }, + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Translate.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Translate.json new file mode 100644 index 000000000000..a079a1d161d2 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Translate.json @@ -0,0 +1,43 @@ +{ + "operationId": "Translator_TextTranslation_Translate", + "title": "Translate specified source language text into the target language text.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "To": "cs", + "body": [ + { + "Text": "This is a test." + } + ] + }, + "responses": { + "200": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Transliterate.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Transliterate.json new file mode 100644 index 000000000000..519773dc34a2 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Transliterate.json @@ -0,0 +1,37 @@ +{ + "operationId": "Translator_TextTranslation_Transliterate", + "title": "Map source language script or alphabet to a target language script or alphabet.", + "parameters": { + "Endpoint": "{Endpoint}", + "ApiVersion": "v3.0", + "Content-Type": "application/json", + "Language": "zh-Hans", + "FromScript": "Hans", + "ToScript": "Latn", + "body": [ + { + "Text": "这是个测试。" + } + ] + }, + "responses": { + "200": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ], + "default": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": { + "error": { + "code": 400000, + "message": "Error Message" + } + } + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json index b3433b257488..09bd60c86b9f 100644 --- a/specification/translation/data-plane/text/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -97,6 +97,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Response for the Break SEntence API.": { + "$ref": "./examples/BreakSentence.json" + } } } }, @@ -169,6 +174,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Response for the dictionary examples API.": { + "$ref": "./examples/DictionaryExamples.json" + } } } }, @@ -241,6 +251,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Response for the dictionary lookup API": { + "$ref": "./examples/DictionaryLookup.json" + } } } }, @@ -304,6 +319,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Supported Languages": { + "$ref": "./examples/GetLanguages.json" + } } } }, @@ -407,6 +427,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Translation API response": { + "$ref": "./examples/Translate.json" + } } } }, @@ -474,6 +499,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Response for the tranliteration API": { + "$ref": "./examples/Transliterate.json" + } } } } @@ -1541,7 +1571,7 @@ "name": "textType", "in": "query", "required": false, - "default": "Plain", + "default": "plain", "type": "string", "enum": [ "plain", From 662c05bdf50a21187a3021d4faa1d11705f49786 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 24 Mar 2023 14:39:11 -0700 Subject: [PATCH 12/27] Fixing path to examples --- .../data-plane/text/stable/v3.0/openapi.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json index 09bd60c86b9f..1f10771555fc 100644 --- a/specification/translation/data-plane/text/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -100,7 +100,7 @@ }, "x-ms-examples": { "Response for the Break SEntence API.": { - "$ref": "./examples/BreakSentence.json" + "$ref": "./examples/3.0/BreakSentence.json" } } } @@ -177,7 +177,7 @@ }, "x-ms-examples": { "Response for the dictionary examples API.": { - "$ref": "./examples/DictionaryExamples.json" + "$ref": "./examples/3.0/DictionaryExamples.json" } } } @@ -254,7 +254,7 @@ }, "x-ms-examples": { "Response for the dictionary lookup API": { - "$ref": "./examples/DictionaryLookup.json" + "$ref": "./examples/3.0/DictionaryLookup.json" } } } @@ -322,7 +322,7 @@ }, "x-ms-examples": { "Supported Languages": { - "$ref": "./examples/GetLanguages.json" + "$ref": "./examples/3.0/GetLanguages.json" } } } @@ -430,7 +430,7 @@ }, "x-ms-examples": { "Translation API response": { - "$ref": "./examples/Translate.json" + "$ref": "./examples/3.0/Translate.json" } } } @@ -502,7 +502,7 @@ }, "x-ms-examples": { "Response for the tranliteration API": { - "$ref": "./examples/Transliterate.json" + "$ref": "./examples/3.0/Transliterate.json" } } } From 79d386bc3d16bdf903475d41eb772b41abcb7039 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 24 Mar 2023 14:56:30 -0700 Subject: [PATCH 13/27] Speel check fix --- cSpell.json | 10 ++++++++++ .../data-plane/text/stable/v3.0/openapi.json | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cSpell.json b/cSpell.json index ce410562d110..4739fdb3b71e 100644 --- a/cSpell.json +++ b/cSpell.json @@ -907,6 +907,16 @@ "workflowruns", "workflowtasks" ] + }, + { + "filename": "**/specification/translation/data-plane/**/*.json", + "words": [ + "autodetection", + "breaksentence", + "mosca", + "Transliterable", + "translitered" + ] } ], "enableFiletypes": [ diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json index 1f10771555fc..aa27c5e51395 100644 --- a/specification/translation/data-plane/text/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -141,7 +141,7 @@ "type": "string" }, { - "$ref": "#/parameters/DictionaryExamplesParamters.content" + "$ref": "#/parameters/DictionaryExamplesParameters.content" } ], "responses": { @@ -218,7 +218,7 @@ "type": "string" }, { - "$ref": "#/parameters/DictionaryLookupParamters.content" + "$ref": "#/parameters/DictionaryLookupParameters.content" } ], "responses": { @@ -501,7 +501,7 @@ } }, "x-ms-examples": { - "Response for the tranliteration API": { + "Response for the transliteration API": { "$ref": "./examples/3.0/Transliterate.json" } } @@ -841,7 +841,7 @@ "code": { "type": "integer", "format": "int32", - "description": "Number indetifier of the error." + "description": "Number identifier of the error." }, "message": { "type": "string", @@ -1378,7 +1378,7 @@ "type": "string", "x-ms-parameter-location": "method" }, - "DictionaryExamplesParamters.content": { + "DictionaryExamplesParameters.content": { "name": "content", "in": "body", "required": true, @@ -1393,7 +1393,7 @@ }, "x-ms-parameter-location": "method" }, - "DictionaryLookupParamters.content": { + "DictionaryLookupParameters.content": { "name": "content", "in": "body", "required": true, From 717993d4e871d9f54f7941c00fb17846785057ba Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 12:25:39 -0700 Subject: [PATCH 14/27] Updating name of TS exporter --- specification/translation/text/package.json | 1 + specification/translation/text/tspconfig.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/translation/text/package.json b/specification/translation/text/package.json index 494e54738f27..1868b525f684 100644 --- a/specification/translation/text/package.json +++ b/specification/translation/text/package.json @@ -11,6 +11,7 @@ "@azure-tools/typespec-csharp": "latest", "@azure-tools/typespec-python": "latest", "@azure-tools/typespec-java": "latest", + "@azure-tools/typespec-ts": "latest", "@typespec/compiler": "latest", "@typespec/openapi": "latest", "@typespec/openapi3": "latest", diff --git a/specification/translation/text/tspconfig.yaml b/specification/translation/text/tspconfig.yaml index c88b8126122b..d1ede9180152 100644 --- a/specification/translation/text/tspconfig.yaml +++ b/specification/translation/text/tspconfig.yaml @@ -13,7 +13,7 @@ emitters: "@azure-tools/typespec-java": partial-update: true namespace: com.azure.ai.translation.text - "@azure-tools/typespec-typescript": + "@azure-tools/typespec-ts": generateMetadata: true generateTest: true azureSdkForJs: true From 235b62a0be6a7fbbd7275f653d1c7825988d5178 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 13:39:34 -0700 Subject: [PATCH 15/27] Updating openapi.json --- .../data-plane/text/stable/v3.0/openapi.json | 216 +++++++++--------- .../translation/text/models-breaksentence.tsp | 4 - .../translation/text/models-dictionary.tsp | 8 - .../translation/text/models-translate.tsp | 4 - .../translation/text/models-transliterate.tsp | 4 - specification/translation/text/routes.tsp | 24 +- 6 files changed, 126 insertions(+), 134 deletions(-) diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json index aa27c5e51395..c58bd77e8b0b 100644 --- a/specification/translation/data-plane/text/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -60,11 +60,23 @@ "name": "api-version", "in": "query", "required": true, + "description": "Mandatory API version parameter", "x-ms-client-name": "apiVersion", "type": "string" }, { - "$ref": "#/parameters/BreakSentenceParameters.content" + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + } } ], "responses": { @@ -97,11 +109,6 @@ "$ref": "#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Response for the Break SEntence API.": { - "$ref": "./examples/3.0/BreakSentence.json" - } } } }, @@ -137,11 +144,23 @@ "name": "api-version", "in": "query", "required": true, + "description": "Mandatory API version parameter", "x-ms-client-name": "apiVersion", "type": "string" }, { - "$ref": "#/parameters/DictionaryExamplesParameters.content" + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExampleTextItem[]" + } } ], "responses": { @@ -174,11 +193,6 @@ "$ref": "#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Response for the dictionary examples API.": { - "$ref": "./examples/3.0/DictionaryExamples.json" - } } } }, @@ -214,11 +228,23 @@ "name": "api-version", "in": "query", "required": true, + "description": "Mandatory API version parameter", "x-ms-client-name": "apiVersion", "type": "string" }, { - "$ref": "#/parameters/DictionaryLookupParameters.content" + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + } } ], "responses": { @@ -251,11 +277,6 @@ "$ref": "#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Response for the dictionary lookup API": { - "$ref": "./examples/3.0/DictionaryLookup.json" - } } } }, @@ -286,6 +307,7 @@ "name": "api-version", "in": "query", "required": true, + "description": "Mandatory API version parameter", "x-ms-client-name": "apiVersion", "type": "string" } @@ -319,11 +341,6 @@ "$ref": "#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Supported Languages": { - "$ref": "./examples/3.0/GetLanguages.json" - } } } }, @@ -381,11 +398,23 @@ "name": "api-version", "in": "query", "required": true, + "description": "Mandatory API version parameter", "x-ms-client-name": "apiVersion", "type": "string" }, { - "$ref": "#/parameters/TranslateParameters.content" + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + } } ], "responses": { @@ -427,11 +456,6 @@ "$ref": "#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Translation API response": { - "$ref": "./examples/3.0/Translate.json" - } } } }, @@ -462,11 +486,23 @@ "name": "api-version", "in": "query", "required": true, + "description": "Mandatory API version parameter", "x-ms-client-name": "apiVersion", "type": "string" }, { - "$ref": "#/parameters/TransliterateParameters.content" + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + } } ], "responses": { @@ -499,11 +535,6 @@ "$ref": "#/definitions/ErrorResponse" } } - }, - "x-ms-examples": { - "Response for the transliteration API": { - "$ref": "./examples/3.0/Transliterate.json" - } } } } @@ -727,6 +758,24 @@ } ] }, + "DictionaryExamplesParamters": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." + }, + "to": { + "type": "string", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." + } + }, + "description": "Request paramters for the dictionary examples API.", + "required": [ + "from", + "to" + ] + }, "DictionaryExamplesResult": { "type": "object", "properties": { @@ -773,6 +822,24 @@ "translations" ] }, + "DictionaryLookupParamters": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." + }, + "to": { + "type": "string", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." + } + }, + "description": "Request parameters for the dictionary lookup API.", + "required": [ + "from", + "to" + ] + }, "DictionaryLookupResult": { "type": "object", "properties": { @@ -841,7 +908,7 @@ "code": { "type": "integer", "format": "int32", - "description": "Number identifier of the error." + "description": "Number indetifier of the error." }, "message": { "type": "string", @@ -1347,21 +1414,6 @@ } }, "parameters": { - "BreakSentenceParameters.content": { - "name": "content", - "in": "body", - "required": true, - "description": "Array of the text for which values the sentence boundaries will be calculated.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "InputTextItem[]" - }, - "x-ms-parameter-location": "method" - }, "BreakSentenceParameters.language": { "name": "language", "in": "query", @@ -1378,36 +1430,6 @@ "type": "string", "x-ms-parameter-location": "method" }, - "DictionaryExamplesParameters.content": { - "name": "content", - "in": "body", - "required": true, - "description": "Array of the text to be sent to dictionary.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExampleTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "DictionaryExampleTextItem[]" - }, - "x-ms-parameter-location": "method" - }, - "DictionaryLookupParameters.content": { - "name": "content", - "in": "body", - "required": true, - "description": "Array of the text to be sent to dictionary.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "InputTextItem[]" - }, - "x-ms-parameter-location": "method" - }, "GetLanguageParameters.acceptLanguage": { "name": "Accept-Language", "in": "header", @@ -1453,21 +1475,6 @@ "type": "string", "x-ms-parameter-location": "method" }, - "TranslateParameters.content": { - "name": "content", - "in": "body", - "required": true, - "description": "Array of the text to be translated.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "InputTextItem[]" - }, - "x-ms-parameter-location": "method" - }, "TranslateParameters.from": { "name": "from", "in": "query", @@ -1571,7 +1578,7 @@ "name": "textType", "in": "query", "required": false, - "default": "plain", + "default": "Plain", "type": "string", "enum": [ "plain", @@ -1613,21 +1620,6 @@ "type": "string", "x-ms-parameter-location": "method" }, - "TransliterateParameters.content": { - "name": "content", - "in": "body", - "required": true, - "description": "Array of the text to be transliterated.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "InputTextItem[]" - }, - "x-ms-parameter-location": "method" - }, "TransliterateParameters.fromScript": { "name": "fromScript", "in": "query", diff --git a/specification/translation/text/models-breaksentence.tsp b/specification/translation/text/models-breaksentence.tsp index 724d6297bdf7..5f610cce63b6 100644 --- a/specification/translation/text/models-breaksentence.tsp +++ b/specification/translation/text/models-breaksentence.tsp @@ -26,10 +26,6 @@ model BreakSentenceParameters { If a script isn't specified, the default script of the language will be assumed. """) script?: string; - - @body - @doc("Array of the text for which values the sentence boundaries will be calculated.") - content: InputTextItem[]; } @doc("Response for the Break SEntence API.") diff --git a/specification/translation/text/models-dictionary.tsp b/specification/translation/text/models-dictionary.tsp index 395fb1b8c655..4ca843b65a2a 100644 --- a/specification/translation/text/models-dictionary.tsp +++ b/specification/translation/text/models-dictionary.tsp @@ -29,19 +29,11 @@ alias DictionaryBaseParameters = { @doc("Request parameters for the dictionary lookup API.") model DictionaryLookupParamters { ...DictionaryBaseParameters; - - @body - @doc("Array of the text to be sent to dictionary.") - content: InputTextItem[]; } @doc("Request paramters for the dictionary examples API.") model DictionaryExamplesParamters { ...DictionaryBaseParameters; - - @body - @doc("Array of the text to be sent to dictionary.") - content: DictionaryExampleTextItem[]; } @doc("Response for the dictionary lookup API.") diff --git a/specification/translation/text/models-translate.tsp b/specification/translation/text/models-translate.tsp index c86e7bce10ff..603a48ee6302 100644 --- a/specification/translation/text/models-translate.tsp +++ b/specification/translation/text/models-translate.tsp @@ -108,10 +108,6 @@ model TranslateParameters { specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. """) allowFallback?: boolean = true; - - @body - @doc("Array of the text to be translated.") - content: InputTextItem[]; } @doc("Response for the translation API.") diff --git a/specification/translation/text/models-transliterate.tsp b/specification/translation/text/models-transliterate.tsp index 9d8855beb9c9..9b83982e17fb 100644 --- a/specification/translation/text/models-transliterate.tsp +++ b/specification/translation/text/models-transliterate.tsp @@ -33,10 +33,6 @@ model TransliterateParameters { scripts available for the selected combination of input language and input script. """) toScript: string; - - @body - @doc("Array of the text to be transliterated.") - content: InputTextItem[]; } @doc("Response for the transliteration API.") diff --git a/specification/translation/text/routes.tsp b/specification/translation/text/routes.tsp index 578139a632f4..59de2e274c5e 100644 --- a/specification/translation/text/routes.tsp +++ b/specification/translation/text/routes.tsp @@ -12,9 +12,24 @@ using TypeSpec.Http; namespace TextTranslation; -op CustomOperation( +@doc("Defines Text Translation custom Operation") +op CustomOperation( ...TParams, + @doc("Defines the content of the request") + @body + requestBody: TBody, + + @doc("Mandatory API version parameter") + @query("api-version") + apiVersion: string +): TResponse | TError; + +@doc("Defines Text Translation custom Operations which doesn't have any content in the request") +op CustomGetOperation( + ...TParams, + + @doc("Mandatory API version parameter") @query("api-version") apiVersion: string ): TResponse | TError; @@ -23,7 +38,7 @@ op CustomOperation( @route("languages") @summary("Gets the set of languages currently supported by other operations of the Translator.") @doc("Gets the set of languages currently supported by other operations of the Translator.") -op GetLanguages is CustomOperation< +op GetLanguages is CustomGetOperation< GetLanguageParameters, GetLanguagesResult, {}, @@ -35,6 +50,7 @@ op GetLanguages is CustomOperation< @summary("Translate Text") @doc("Translate Text") op Translate is CustomOperation< + InputTextItem[], TranslateParameters, TranslationResult, {}, @@ -46,6 +62,7 @@ op Translate is CustomOperation< @summary("Transliterate Text") @doc("Transliterate Text") op Transliterate is CustomOperation< + InputTextItem[], TransliterateParameters, TransliterateResult, {}, @@ -57,6 +74,7 @@ op Transliterate is CustomOperation< @summary("Find Sentence Boundaries") @doc("Find Sentence Boundaries") op FindSentenceBoundaries is CustomOperation< + InputTextItem[], BreakSentenceParameters, BreakSentenceResult, {}, @@ -68,6 +86,7 @@ op FindSentenceBoundaries is CustomOperation< @summary("Lookup Dictionary Entries") @doc("Lookup Dictionary Entries") op LookupDictionaryEntries is CustomOperation< + InputTextItem[], DictionaryLookupParamters, DictionaryLookupResult, {}, @@ -79,6 +98,7 @@ op LookupDictionaryEntries is CustomOperation< @summary("Lookup Dictionary Examples") @doc("Lookup Dictionary Examples") op LookupDictionaryExamples is CustomOperation< + DictionaryExampleTextItem[], DictionaryExamplesParamters, DictionaryExamplesResult, {}, From cd3c1206ddeb8562a2afd77308de980584960018 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 13:55:52 -0700 Subject: [PATCH 16/27] Linting, spell check fixes --- .../data-plane/text/stable/v3.0/openapi.json | 32 ++++++++++++++++++- .../translation/text/models-dictionary.tsp | 6 ++-- .../translation/text/models-shared.tsp | 2 +- specification/translation/text/routes.tsp | 4 +-- specification/translation/text/tspconfig.yaml | 9 +++++- 5 files changed, 45 insertions(+), 8 deletions(-) diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json index c58bd77e8b0b..9d34ec789955 100644 --- a/specification/translation/data-plane/text/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -109,6 +109,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Find Sentence Boundaries result": { + "$ref": "./examples/3.0/BreakSentence.json" + } } } }, @@ -193,6 +198,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Lookup Dictionary Examples result": { + "$ref": "./examples/3.0/DictionaryExamples.json" + } } } }, @@ -277,6 +287,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Lookup Dictionary Entries result": { + "$ref": "./examples/3.0/DictionaryLookup.json" + } } } }, @@ -341,6 +356,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get Languages result": { + "$ref": "./examples/3.0/GetLanguages.json" + } } } }, @@ -456,6 +476,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Translate Text result": { + "$ref": "./examples/3.0/Translate.json" + } } } }, @@ -535,6 +560,11 @@ "$ref": "#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Transliterate Text result": { + "$ref": "./examples/3.0/Transliterate.json" + } } } } @@ -1578,7 +1608,7 @@ "name": "textType", "in": "query", "required": false, - "default": "Plain", + "default": "plain", "type": "string", "enum": [ "plain", diff --git a/specification/translation/text/models-dictionary.tsp b/specification/translation/text/models-dictionary.tsp index 4ca843b65a2a..b3af9ed3b942 100644 --- a/specification/translation/text/models-dictionary.tsp +++ b/specification/translation/text/models-dictionary.tsp @@ -27,12 +27,12 @@ alias DictionaryBaseParameters = { }; @doc("Request parameters for the dictionary lookup API.") -model DictionaryLookupParamters { +model DictionaryLookupParameters { ...DictionaryBaseParameters; } -@doc("Request paramters for the dictionary examples API.") -model DictionaryExamplesParamters { +@doc("Request parameters for the dictionary examples API.") +model DictionaryExamplesParameters { ...DictionaryBaseParameters; } diff --git a/specification/translation/text/models-shared.tsp b/specification/translation/text/models-shared.tsp index 2402d30c67cd..87df889e0c2b 100644 --- a/specification/translation/text/models-shared.tsp +++ b/specification/translation/text/models-shared.tsp @@ -40,7 +40,7 @@ model ErrorResponse { @doc("Error details as returned by Translator Service.") model ErrorDetails { - @doc("Number indetifier of the error.") + @doc("Number identifier of the error.") code: int32; @doc("Human readable error description.") diff --git a/specification/translation/text/routes.tsp b/specification/translation/text/routes.tsp index 59de2e274c5e..aee55b5cd0b1 100644 --- a/specification/translation/text/routes.tsp +++ b/specification/translation/text/routes.tsp @@ -87,7 +87,7 @@ op FindSentenceBoundaries is CustomOperation< @doc("Lookup Dictionary Entries") op LookupDictionaryEntries is CustomOperation< InputTextItem[], - DictionaryLookupParamters, + DictionaryLookupParameters, DictionaryLookupResult, {}, ErrorResponse @@ -99,7 +99,7 @@ op LookupDictionaryEntries is CustomOperation< @doc("Lookup Dictionary Examples") op LookupDictionaryExamples is CustomOperation< DictionaryExampleTextItem[], - DictionaryExamplesParamters, + DictionaryExamplesParameters, DictionaryExamplesResult, {}, ErrorResponse diff --git a/specification/translation/text/tspconfig.yaml b/specification/translation/text/tspconfig.yaml index d1ede9180152..737cd3258c2b 100644 --- a/specification/translation/text/tspconfig.yaml +++ b/specification/translation/text/tspconfig.yaml @@ -1,4 +1,11 @@ -emitters: +emit: [ + "@azure-tools/typespec-autorest", + "@azure-tools/typespec-csharp", + "@azure-tools/typespec-python", + "@azure-tools/typespec-java", + "@azure-tools/typespec-ts" +] +options: "@azure-tools/typespec-autorest": "output-file": "openapi.json" "examples-directory": ./examples From 32d2df8049de09d154340e748ac8b6741e355024 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 14:24:30 -0700 Subject: [PATCH 17/27] Fix spelling --- .../translation/data-plane/text/stable/v3.0/openapi.json | 8 ++++---- specification/translation/text/tspconfig.yaml | 7 ------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json index 9d34ec789955..17e52e3b74b9 100644 --- a/specification/translation/data-plane/text/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -788,7 +788,7 @@ } ] }, - "DictionaryExamplesParamters": { + "DictionaryExamplesParameters": { "type": "object", "properties": { "from": { @@ -800,7 +800,7 @@ "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." } }, - "description": "Request paramters for the dictionary examples API.", + "description": "Request parameters for the dictionary examples API.", "required": [ "from", "to" @@ -852,7 +852,7 @@ "translations" ] }, - "DictionaryLookupParamters": { + "DictionaryLookupParameters": { "type": "object", "properties": { "from": { @@ -938,7 +938,7 @@ "code": { "type": "integer", "format": "int32", - "description": "Number indetifier of the error." + "description": "Number identifier of the error." }, "message": { "type": "string", diff --git a/specification/translation/text/tspconfig.yaml b/specification/translation/text/tspconfig.yaml index 737cd3258c2b..649f1d0743d4 100644 --- a/specification/translation/text/tspconfig.yaml +++ b/specification/translation/text/tspconfig.yaml @@ -1,10 +1,3 @@ -emit: [ - "@azure-tools/typespec-autorest", - "@azure-tools/typespec-csharp", - "@azure-tools/typespec-python", - "@azure-tools/typespec-java", - "@azure-tools/typespec-ts" -] options: "@azure-tools/typespec-autorest": "output-file": "openapi.json" From 94522ca6b4a4feb9644420f893c5f723f9df52b0 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 15:03:59 -0700 Subject: [PATCH 18/27] Test removing generators --- specification/translation/text/package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/specification/translation/text/package.json b/specification/translation/text/package.json index 1868b525f684..c9aa63501198 100644 --- a/specification/translation/text/package.json +++ b/specification/translation/text/package.json @@ -8,10 +8,6 @@ "@azure-tools/typespec-autorest": "latest", "@azure-tools/typespec-azure-core": "latest", "@azure-tools/typespec-client-generator-core": "latest", - "@azure-tools/typespec-csharp": "latest", - "@azure-tools/typespec-python": "latest", - "@azure-tools/typespec-java": "latest", - "@azure-tools/typespec-ts": "latest", "@typespec/compiler": "latest", "@typespec/openapi": "latest", "@typespec/openapi3": "latest", From 0b8ef39a9092989422716d30227424be05f4333f Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 15:37:22 -0700 Subject: [PATCH 19/27] Fixing BS example --- .../v3.0/examples/3.0/BreakSentence.json | 32 +++++++++++-------- .../text/examples/3.0/BreakSentence.json | 32 +++++++++++-------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json index 109d4a6e39d5..b5633567b58a 100644 --- a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json +++ b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json @@ -12,19 +12,25 @@ ] }, "responses": { - "200": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "sentLen": [ - 13, - 11, - 22 - ] - } - ], + "200": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + }, "default": { "headers": { "Content-Type": "application/json", diff --git a/specification/translation/text/examples/3.0/BreakSentence.json b/specification/translation/text/examples/3.0/BreakSentence.json index 109d4a6e39d5..b5633567b58a 100644 --- a/specification/translation/text/examples/3.0/BreakSentence.json +++ b/specification/translation/text/examples/3.0/BreakSentence.json @@ -12,19 +12,25 @@ ] }, "responses": { - "200": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "sentLen": [ - 13, - 11, - 22 - ] - } - ], + "200": { + "headers": { + "Content-Type": "application/json", + "x-requestid": "Request id for tracing" + }, + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + }, "default": { "headers": { "Content-Type": "application/json", From 7e5a9f940a07a3ea15c59fda50ac3d7253e7c95f Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 16:17:01 -0700 Subject: [PATCH 20/27] Fixing model generation --- .../v3.0/examples/3.0/BreakSentence.json | 47 - .../v3.0/examples/3.0/DictionaryExamples.json | 55 - .../v3.0/examples/3.0/DictionaryLookup.json | 98 - .../v3.0/examples/3.0/GetLanguages.json | 2665 ----------------- .../stable/v3.0/examples/3.0/Translate.json | 43 - .../v3.0/examples/3.0/Transliterate.json | 37 - ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 + .../examples/GetLanguages_MinimumSet_Gen.json | 12 + ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 + ...okupDictionaryExamples_MinimumSet_Gen.json | 43 + .../examples/Translate_MinimumSet_Gen.json | 29 + .../Transliterate_MinimumSet_Gen.json | 25 + .../data-plane/text/stable/v3.0/openapi.json | 26 +- .../text/examples/3.0/BreakSentence.json | 47 - .../text/examples/3.0/DictionaryExamples.json | 55 - .../text/examples/3.0/DictionaryLookup.json | 98 - ...FindSentenceBoundaries_MaximumSet_Gen.json | 28 + ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 + .../text/examples/3.0/GetLanguages.json | 2665 ----------------- .../3.0/GetLanguages_MaximumSet_Gen.json | 80 + .../3.0/GetLanguages_MinimumSet_Gen.json | 12 + ...ookupDictionaryEntries_MaximumSet_Gen.json | 87 + ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 + ...okupDictionaryExamples_MaximumSet_Gen.json | 44 + ...okupDictionaryExamples_MinimumSet_Gen.json | 43 + .../text/examples/3.0/Translate.json | 43 - .../3.0/Translate_MaximumSet_Gen.json | 63 + .../3.0/Translate_MinimumSet_Gen.json | 29 + .../text/examples/3.0/Transliterate.json | 37 - .../3.0/Transliterate_MaximumSet_Gen.json | 26 + .../3.0/Transliterate_MinimumSet_Gen.json | 25 + ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 + .../examples/GetLanguages_MinimumSet_Gen.json | 12 + ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 + ...okupDictionaryExamples_MinimumSet_Gen.json | 43 + .../examples/Translate_MinimumSet_Gen.json | 29 + .../Transliterate_MinimumSet_Gen.json | 25 + .../typespec-autorest/3.0/openapi.json | 1678 +++++++++++ 38 files changed, 2691 insertions(+), 5903 deletions(-) delete mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json delete mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryExamples.json delete mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryLookup.json delete mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/GetLanguages.json delete mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/Translate.json delete mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/3.0/Transliterate.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json create mode 100644 specification/translation/data-plane/text/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json delete mode 100644 specification/translation/text/examples/3.0/BreakSentence.json delete mode 100644 specification/translation/text/examples/3.0/DictionaryExamples.json delete mode 100644 specification/translation/text/examples/3.0/DictionaryLookup.json create mode 100644 specification/translation/text/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json create mode 100644 specification/translation/text/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json delete mode 100644 specification/translation/text/examples/3.0/GetLanguages.json create mode 100644 specification/translation/text/examples/3.0/GetLanguages_MaximumSet_Gen.json create mode 100644 specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json create mode 100644 specification/translation/text/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json create mode 100644 specification/translation/text/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json create mode 100644 specification/translation/text/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json create mode 100644 specification/translation/text/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json delete mode 100644 specification/translation/text/examples/3.0/Translate.json create mode 100644 specification/translation/text/examples/3.0/Translate_MaximumSet_Gen.json create mode 100644 specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json delete mode 100644 specification/translation/text/examples/3.0/Transliterate.json create mode 100644 specification/translation/text/examples/3.0/Transliterate_MaximumSet_Gen.json create mode 100644 specification/translation/text/examples/3.0/Transliterate_MinimumSet_Gen.json create mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json create mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json create mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json create mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json create mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Translate_MinimumSet_Gen.json create mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Transliterate_MinimumSet_Gen.json create mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/openapi.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json deleted file mode 100644 index b5633567b58a..000000000000 --- a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/BreakSentence.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_BreakSentence", - "title": "Returns an array of integers representing the length of sentences in a source text.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "body": [ - { - "Text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - }, - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryExamples.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryExamples.json deleted file mode 100644 index 28360fce5fd3..000000000000 --- a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryExamples.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_DictionaryExamples", - "title": "Returns alternatives for single word translations.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "From": "en", - "To": "es", - "body": [ - { - "Text": "fly", - "Translation": "volar" - } - ] - }, - "responses": { - "200": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ], - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryLookup.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryLookup.json deleted file mode 100644 index d527b0cfd886..000000000000 --- a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/DictionaryLookup.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_DictionaryLookup", - "title": "Returns alternatives for single word translations.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "From": "en", - "To": "es", - "body": [ - { - "Text": "fly" - } - ] - }, - "responses": { - "200": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ], - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/GetLanguages.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/GetLanguages.json deleted file mode 100644 index a6d1ac627fa8..000000000000 --- a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/GetLanguages.json +++ /dev/null @@ -1,2665 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_GetLanguages", - "title": "Gets the set of languages currently supported by other operations of the Translator.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "body": {} - }, - "responses": { - "200": { - "body": { - "translation": { - "af": { - "name": "Afrikaans", - "nativeName": "Afrikaans", - "dir": "ltr" - }, - "am": { - "name": "Amharic", - "nativeName": "አማርኛ", - "dir": "ltr" - }, - "ar": { - "name": "Arabic", - "nativeName": "العربية", - "dir": "rtl" - }, - "as": { - "name": "Assamese", - "nativeName": "অসমীয়া", - "dir": "ltr" - }, - "az": { - "name": "Azerbaijani", - "nativeName": "Azərbaycan", - "dir": "ltr" - }, - "ba": { - "name": "Bashkir", - "nativeName": "Bashkir", - "dir": "ltr" - }, - "bg": { - "name": "Bulgarian", - "nativeName": "Български", - "dir": "ltr" - }, - "bn": { - "name": "Bangla", - "nativeName": "বাংলা", - "dir": "ltr" - }, - "bo": { - "name": "Tibetan", - "nativeName": "བོད་སྐད་", - "dir": "ltr" - }, - "bs": { - "name": "Bosnian", - "nativeName": "Bosnian", - "dir": "ltr" - }, - "ca": { - "name": "Catalan", - "nativeName": "Català", - "dir": "ltr" - }, - "cs": { - "name": "Czech", - "nativeName": "Čeština", - "dir": "ltr" - }, - "cy": { - "name": "Welsh", - "nativeName": "Cymraeg", - "dir": "ltr" - }, - "da": { - "name": "Danish", - "nativeName": "Dansk", - "dir": "ltr" - }, - "de": { - "name": "German", - "nativeName": "Deutsch", - "dir": "ltr" - }, - "dv": { - "name": "Divehi", - "nativeName": "ދިވެހިބަސް", - "dir": "rtl" - }, - "el": { - "name": "Greek", - "nativeName": "Ελληνικά", - "dir": "ltr" - }, - "en": { - "name": "English", - "nativeName": "English", - "dir": "ltr" - }, - "es": { - "name": "Spanish", - "nativeName": "Español", - "dir": "ltr" - }, - "et": { - "name": "Estonian", - "nativeName": "Eesti", - "dir": "ltr" - }, - "eu": { - "name": "Basque", - "nativeName": "Euskara", - "dir": "ltr" - }, - "fa": { - "name": "Persian", - "nativeName": "فارسی", - "dir": "rtl" - }, - "fi": { - "name": "Finnish", - "nativeName": "Suomi", - "dir": "ltr" - }, - "fil": { - "name": "Filipino", - "nativeName": "Filipino", - "dir": "ltr" - }, - "fj": { - "name": "Fijian", - "nativeName": "Na Vosa Vakaviti", - "dir": "ltr" - }, - "fo": { - "name": "Faroese", - "nativeName": "Føroyskt", - "dir": "ltr" - }, - "fr": { - "name": "French", - "nativeName": "Français", - "dir": "ltr" - }, - "fr-CA": { - "name": "French (Canada)", - "nativeName": "Français (Canada)", - "dir": "ltr" - }, - "ga": { - "name": "Irish", - "nativeName": "Gaeilge", - "dir": "ltr" - }, - "gl": { - "name": "Galician", - "nativeName": "Galego", - "dir": "ltr" - }, - "gu": { - "name": "Gujarati", - "nativeName": "ગુજરાતી", - "dir": "ltr" - }, - "he": { - "name": "Hebrew", - "nativeName": "עברית", - "dir": "rtl" - }, - "hi": { - "name": "Hindi", - "nativeName": "हिन्दी", - "dir": "ltr" - }, - "hr": { - "name": "Croatian", - "nativeName": "Hrvatski", - "dir": "ltr" - }, - "hsb": { - "name": "Upper Sorbian", - "nativeName": "Hornjoserbšćina", - "dir": "ltr" - }, - "ht": { - "name": "Haitian Creole", - "nativeName": "Haitian Creole", - "dir": "ltr" - }, - "hu": { - "name": "Hungarian", - "nativeName": "Magyar", - "dir": "ltr" - }, - "hy": { - "name": "Armenian", - "nativeName": "Հայերեն", - "dir": "ltr" - }, - "id": { - "name": "Indonesian", - "nativeName": "Indonesia", - "dir": "ltr" - }, - "ikt": { - "name": "Inuinnaqtun", - "nativeName": "Inuinnaqtun", - "dir": "ltr" - }, - "is": { - "name": "Icelandic", - "nativeName": "Íslenska", - "dir": "ltr" - }, - "it": { - "name": "Italian", - "nativeName": "Italiano", - "dir": "ltr" - }, - "iu": { - "name": "Inuktitut", - "nativeName": "ᐃᓄᒃᑎᑐᑦ", - "dir": "ltr" - }, - "iu-Latn": { - "name": "Inuktitut (Latin)", - "nativeName": "Inuktitut (Latin)", - "dir": "ltr" - }, - "ja": { - "name": "Japanese", - "nativeName": "日本語", - "dir": "ltr" - }, - "ka": { - "name": "Georgian", - "nativeName": "ქართული", - "dir": "ltr" - }, - "kk": { - "name": "Kazakh", - "nativeName": "Қазақ Тілі", - "dir": "ltr" - }, - "km": { - "name": "Khmer", - "nativeName": "ខ្មែរ", - "dir": "ltr" - }, - "kmr": { - "name": "Kurdish (Northern)", - "nativeName": "Kurdî (Bakur)", - "dir": "ltr" - }, - "kn": { - "name": "Kannada", - "nativeName": "ಕನ್ನಡ", - "dir": "ltr" - }, - "ko": { - "name": "Korean", - "nativeName": "한국어", - "dir": "ltr" - }, - "ku": { - "name": "Kurdish (Central)", - "nativeName": "Kurdî (Navîn)", - "dir": "rtl" - }, - "ky": { - "name": "Kyrgyz", - "nativeName": "Кыргызча", - "dir": "ltr" - }, - "lo": { - "name": "Lao", - "nativeName": "ລາວ", - "dir": "ltr" - }, - "lt": { - "name": "Lithuanian", - "nativeName": "Lietuvių", - "dir": "ltr" - }, - "lv": { - "name": "Latvian", - "nativeName": "Latviešu", - "dir": "ltr" - }, - "lzh": { - "name": "Chinese (Literary)", - "nativeName": "中文 (文言文)", - "dir": "ltr" - }, - "mg": { - "name": "Malagasy", - "nativeName": "Malagasy", - "dir": "ltr" - }, - "mi": { - "name": "Māori", - "nativeName": "Te Reo Māori", - "dir": "ltr" - }, - "mk": { - "name": "Macedonian", - "nativeName": "Македонски", - "dir": "ltr" - }, - "ml": { - "name": "Malayalam", - "nativeName": "മലയാളം", - "dir": "ltr" - }, - "mn-Cyrl": { - "name": "Mongolian (Cyrillic)", - "nativeName": "Mongolian (Cyrillic)", - "dir": "ltr" - }, - "mn-Mong": { - "name": "Mongolian (Traditional)", - "nativeName": "ᠮᠣᠩᠭᠣᠯ ᠬᠡᠯᠡ", - "dir": "ltr" - }, - "mr": { - "name": "Marathi", - "nativeName": "मराठी", - "dir": "ltr" - }, - "ms": { - "name": "Malay", - "nativeName": "Melayu", - "dir": "ltr" - }, - "mt": { - "name": "Maltese", - "nativeName": "Malti", - "dir": "ltr" - }, - "mww": { - "name": "Hmong Daw", - "nativeName": "Hmong Daw", - "dir": "ltr" - }, - "my": { - "name": "Myanmar (Burmese)", - "nativeName": "မြန်မာ", - "dir": "ltr" - }, - "nb": { - "name": "Norwegian", - "nativeName": "Norsk Bokmål", - "dir": "ltr" - }, - "ne": { - "name": "Nepali", - "nativeName": "नेपाली", - "dir": "ltr" - }, - "nl": { - "name": "Dutch", - "nativeName": "Nederlands", - "dir": "ltr" - }, - "or": { - "name": "Odia", - "nativeName": "ଓଡ଼ିଆ", - "dir": "ltr" - }, - "otq": { - "name": "Querétaro Otomi", - "nativeName": "Hñähñu", - "dir": "ltr" - }, - "pa": { - "name": "Punjabi", - "nativeName": "ਪੰਜਾਬੀ", - "dir": "ltr" - }, - "pl": { - "name": "Polish", - "nativeName": "Polski", - "dir": "ltr" - }, - "prs": { - "name": "Dari", - "nativeName": "دری", - "dir": "rtl" - }, - "ps": { - "name": "Pashto", - "nativeName": "پښتو", - "dir": "rtl" - }, - "pt": { - "name": "Portuguese (Brazil)", - "nativeName": "Português (Brasil)", - "dir": "ltr" - }, - "pt-PT": { - "name": "Portuguese (Portugal)", - "nativeName": "Português (Portugal)", - "dir": "ltr" - }, - "ro": { - "name": "Romanian", - "nativeName": "Română", - "dir": "ltr" - }, - "ru": { - "name": "Russian", - "nativeName": "Русский", - "dir": "ltr" - }, - "sk": { - "name": "Slovak", - "nativeName": "Slovenčina", - "dir": "ltr" - }, - "sl": { - "name": "Slovenian", - "nativeName": "Slovenščina", - "dir": "ltr" - }, - "sm": { - "name": "Samoan", - "nativeName": "Gagana Sāmoa", - "dir": "ltr" - }, - "so": { - "name": "Somali", - "nativeName": "Soomaali", - "dir": "ltr" - }, - "sq": { - "name": "Albanian", - "nativeName": "Shqip", - "dir": "ltr" - }, - "sr-Cyrl": { - "name": "Serbian (Cyrillic)", - "nativeName": "Српски (ћирилица)", - "dir": "ltr" - }, - "sr-Latn": { - "name": "Serbian (Latin)", - "nativeName": "Srpski (latinica)", - "dir": "ltr" - }, - "sv": { - "name": "Swedish", - "nativeName": "Svenska", - "dir": "ltr" - }, - "sw": { - "name": "Swahili", - "nativeName": "Kiswahili", - "dir": "ltr" - }, - "ta": { - "name": "Tamil", - "nativeName": "தமிழ்", - "dir": "ltr" - }, - "te": { - "name": "Telugu", - "nativeName": "తెలుగు", - "dir": "ltr" - }, - "th": { - "name": "Thai", - "nativeName": "ไทย", - "dir": "ltr" - }, - "ti": { - "name": "Tigrinya", - "nativeName": "ትግር", - "dir": "ltr" - }, - "tk": { - "name": "Turkmen", - "nativeName": "Türkmen Dili", - "dir": "ltr" - }, - "tlh-Latn": { - "name": "Klingon (Latin)", - "nativeName": "Klingon (Latin)", - "dir": "ltr" - }, - "tlh-Piqd": { - "name": "Klingon (pIqaD)", - "nativeName": "Klingon (pIqaD)", - "dir": "ltr" - }, - "to": { - "name": "Tongan", - "nativeName": "Lea Fakatonga", - "dir": "ltr" - }, - "tr": { - "name": "Turkish", - "nativeName": "Türkçe", - "dir": "ltr" - }, - "tt": { - "name": "Tatar", - "nativeName": "Татар", - "dir": "ltr" - }, - "ty": { - "name": "Tahitian", - "nativeName": "Reo Tahiti", - "dir": "ltr" - }, - "ug": { - "name": "Uyghur", - "nativeName": "ئۇيغۇرچە", - "dir": "rtl" - }, - "uk": { - "name": "Ukrainian", - "nativeName": "Українська", - "dir": "ltr" - }, - "ur": { - "name": "Urdu", - "nativeName": "اردو", - "dir": "rtl" - }, - "uz": { - "name": "Uzbek (Latin)", - "nativeName": "Uzbek (Latin)", - "dir": "ltr" - }, - "vi": { - "name": "Vietnamese", - "nativeName": "Tiếng Việt", - "dir": "ltr" - }, - "yua": { - "name": "Yucatec Maya", - "nativeName": "Yucatec Maya", - "dir": "ltr" - }, - "yue": { - "name": "Cantonese (Traditional)", - "nativeName": "粵語 (繁體)", - "dir": "ltr" - }, - "zh-Hans": { - "name": "Chinese Simplified", - "nativeName": "中文 (简体)", - "dir": "ltr" - }, - "zh-Hant": { - "name": "Chinese Traditional", - "nativeName": "繁體中文 (繁體)", - "dir": "ltr" - }, - "zu": { - "name": "Zulu", - "nativeName": "Isi-Zulu", - "dir": "ltr" - } - }, - "transliteration": { - "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" - } - ] - } - ] - }, - "be": { - "name": "Belarusian", - "nativeName": "Belarusian", - "scripts": [ - { - "code": "Cyrl", - "name": "Cyrillic", - "nativeName": "Cyrillic", - "dir": "ltr", - "toScripts": [ - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr" - } - ] - }, - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr", - "toScripts": [ - { - "code": "Cyrl", - "name": "Cyrillic", - "nativeName": "Cyrillic", - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "sd": { - "name": "Sindhi", - "nativeName": "سنڌي", - "scripts": [ - { - "code": "Arab", - "name": "Arabic", - "nativeName": "Arabic", - "dir": "ltr", - "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": "ltr" - } - ] - } - ] - }, - "si": { - "name": "Sinhala", - "nativeName": "සිංහල", - "scripts": [ - { - "code": "Sinh", - "name": "Sinhala", - "nativeName": "Sinhala", - "dir": "ltr", - "toScripts": [ - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr" - } - ] - }, - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr", - "toScripts": [ - { - "code": "Sinh", - "name": "Sinhala", - "nativeName": "Sinhala", - "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": "Cyrillic", - "dir": "ltr", - "toScripts": [ - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr" - } - ] - }, - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr", - "toScripts": [ - { - "code": "Cyrl", - "name": "Cyrillic", - "nativeName": "Cyrillic", - "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" - } - ] - } - ] - } - }, - "dictionary": { - "af": { - "name": "Afrikaans", - "nativeName": "Afrikaans", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ar": { - "name": "Arabic", - "nativeName": "العربية", - "dir": "rtl", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "bg": { - "name": "Bulgarian", - "nativeName": "Български", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "bn": { - "name": "Bangla", - "nativeName": "বাংলা", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "bs": { - "name": "Bosnian", - "nativeName": "Bosnian", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ca": { - "name": "Catalan", - "nativeName": "Català", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "cs": { - "name": "Czech", - "nativeName": "Čeština", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "cy": { - "name": "Welsh", - "nativeName": "Cymraeg", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "da": { - "name": "Danish", - "nativeName": "Dansk", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "de": { - "name": "German", - "nativeName": "Deutsch", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "el": { - "name": "Greek", - "nativeName": "Ελληνικά", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "en": { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "translations": [ - { - "name": "Afrikaans", - "nativeName": "Afrikaans", - "dir": "ltr", - "code": "af" - }, - { - "name": "Arabic", - "nativeName": "العربية", - "dir": "rtl", - "code": "ar" - }, - { - "name": "Bulgarian", - "nativeName": "Български", - "dir": "ltr", - "code": "bg" - }, - { - "name": "Bangla", - "nativeName": "বাংলা", - "dir": "ltr", - "code": "bn" - }, - { - "name": "Bosnian", - "nativeName": "Bosnian", - "dir": "ltr", - "code": "bs" - }, - { - "name": "Catalan", - "nativeName": "Català", - "dir": "ltr", - "code": "ca" - }, - { - "name": "Chinese Simplified", - "nativeName": "中文 (简体)", - "dir": "ltr", - "code": "zh-Hans" - }, - { - "name": "Czech", - "nativeName": "Čeština", - "dir": "ltr", - "code": "cs" - }, - { - "name": "Welsh", - "nativeName": "Cymraeg", - "dir": "ltr", - "code": "cy" - }, - { - "name": "Danish", - "nativeName": "Dansk", - "dir": "ltr", - "code": "da" - }, - { - "name": "German", - "nativeName": "Deutsch", - "dir": "ltr", - "code": "de" - }, - { - "name": "Greek", - "nativeName": "Ελληνικά", - "dir": "ltr", - "code": "el" - }, - { - "name": "Spanish", - "nativeName": "Español", - "dir": "ltr", - "code": "es" - }, - { - "name": "Estonian", - "nativeName": "Eesti", - "dir": "ltr", - "code": "et" - }, - { - "name": "Persian", - "nativeName": "فارسی", - "dir": "rtl", - "code": "fa" - }, - { - "name": "Finnish", - "nativeName": "Suomi", - "dir": "ltr", - "code": "fi" - }, - { - "name": "French", - "nativeName": "Français", - "dir": "ltr", - "code": "fr" - }, - { - "name": "Hebrew", - "nativeName": "עברית", - "dir": "rtl", - "code": "he" - }, - { - "name": "Hindi", - "nativeName": "हिन्दी", - "dir": "ltr", - "code": "hi" - }, - { - "name": "Croatian", - "nativeName": "Hrvatski", - "dir": "ltr", - "code": "hr" - }, - { - "name": "Hungarian", - "nativeName": "Magyar", - "dir": "ltr", - "code": "hu" - }, - { - "name": "Indonesian", - "nativeName": "Indonesia", - "dir": "ltr", - "code": "id" - }, - { - "name": "Icelandic", - "nativeName": "Íslenska", - "dir": "ltr", - "code": "is" - }, - { - "name": "Italian", - "nativeName": "Italiano", - "dir": "ltr", - "code": "it" - }, - { - "name": "Japanese", - "nativeName": "日本語", - "dir": "ltr", - "code": "ja" - }, - { - "name": "Korean", - "nativeName": "한국어", - "dir": "ltr", - "code": "ko" - }, - { - "name": "Lithuanian", - "nativeName": "Lietuvių", - "dir": "ltr", - "code": "lt" - }, - { - "name": "Latvian", - "nativeName": "Latviešu", - "dir": "ltr", - "code": "lv" - }, - { - "name": "Maltese", - "nativeName": "Malti", - "dir": "ltr", - "code": "mt" - }, - { - "name": "Malay", - "nativeName": "Melayu", - "dir": "ltr", - "code": "ms" - }, - { - "name": "Hmong Daw", - "nativeName": "Hmong Daw", - "dir": "ltr", - "code": "mww" - }, - { - "name": "Dutch", - "nativeName": "Nederlands", - "dir": "ltr", - "code": "nl" - }, - { - "name": "Norwegian", - "nativeName": "Norsk Bokmål", - "dir": "ltr", - "code": "nb" - }, - { - "name": "Polish", - "nativeName": "Polski", - "dir": "ltr", - "code": "pl" - }, - { - "name": "Portuguese (Brazil)", - "nativeName": "Português (Brasil)", - "dir": "ltr", - "code": "pt" - }, - { - "name": "Romanian", - "nativeName": "Română", - "dir": "ltr", - "code": "ro" - }, - { - "name": "Russian", - "nativeName": "Русский", - "dir": "ltr", - "code": "ru" - }, - { - "name": "Slovak", - "nativeName": "Slovenčina", - "dir": "ltr", - "code": "sk" - }, - { - "name": "Slovenian", - "nativeName": "Slovenščina", - "dir": "ltr", - "code": "sl" - }, - { - "name": "Serbian (Latin)", - "nativeName": "Srpski (latinica)", - "dir": "ltr", - "code": "sr-Latn" - }, - { - "name": "Swedish", - "nativeName": "Svenska", - "dir": "ltr", - "code": "sv" - }, - { - "name": "Swahili", - "nativeName": "Kiswahili", - "dir": "ltr", - "code": "sw" - }, - { - "name": "Tamil", - "nativeName": "தமிழ்", - "dir": "ltr", - "code": "ta" - }, - { - "name": "Thai", - "nativeName": "ไทย", - "dir": "ltr", - "code": "th" - }, - { - "name": "Klingon (Latin)", - "nativeName": "Klingon (Latin)", - "dir": "ltr", - "code": "tlh-Latn" - }, - { - "name": "Turkish", - "nativeName": "Türkçe", - "dir": "ltr", - "code": "tr" - }, - { - "name": "Ukrainian", - "nativeName": "Українська", - "dir": "ltr", - "code": "uk" - }, - { - "name": "Urdu", - "nativeName": "اردو", - "dir": "rtl", - "code": "ur" - }, - { - "name": "Vietnamese", - "nativeName": "Tiếng Việt", - "dir": "ltr", - "code": "vi" - } - ] - }, - "es": { - "name": "Spanish", - "nativeName": "Español", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "et": { - "name": "Estonian", - "nativeName": "Eesti", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "fa": { - "name": "Persian", - "nativeName": "فارسی", - "dir": "rtl", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "fi": { - "name": "Finnish", - "nativeName": "Suomi", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "fr": { - "name": "French", - "nativeName": "Français", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "he": { - "name": "Hebrew", - "nativeName": "עברית", - "dir": "rtl", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "hi": { - "name": "Hindi", - "nativeName": "हिन्दी", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "hr": { - "name": "Croatian", - "nativeName": "Hrvatski", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "hu": { - "name": "Hungarian", - "nativeName": "Magyar", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "id": { - "name": "Indonesian", - "nativeName": "Indonesia", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "is": { - "name": "Icelandic", - "nativeName": "Íslenska", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "it": { - "name": "Italian", - "nativeName": "Italiano", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ja": { - "name": "Japanese", - "nativeName": "日本語", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ko": { - "name": "Korean", - "nativeName": "한국어", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "lt": { - "name": "Lithuanian", - "nativeName": "Lietuvių", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "lv": { - "name": "Latvian", - "nativeName": "Latviešu", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ms": { - "name": "Malay", - "nativeName": "Melayu", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "mt": { - "name": "Maltese", - "nativeName": "Malti", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "mww": { - "name": "Hmong Daw", - "nativeName": "Hmong Daw", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "nb": { - "name": "Norwegian", - "nativeName": "Norsk Bokmål", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "nl": { - "name": "Dutch", - "nativeName": "Nederlands", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "pl": { - "name": "Polish", - "nativeName": "Polski", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "pt": { - "name": "Portuguese (Brazil)", - "nativeName": "Português (Brasil)", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ro": { - "name": "Romanian", - "nativeName": "Română", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ru": { - "name": "Russian", - "nativeName": "Русский", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sk": { - "name": "Slovak", - "nativeName": "Slovenčina", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sl": { - "name": "Slovenian", - "nativeName": "Slovenščina", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sr-Latn": { - "name": "Serbian (Latin)", - "nativeName": "Srpski (latinica)", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sv": { - "name": "Swedish", - "nativeName": "Svenska", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sw": { - "name": "Swahili", - "nativeName": "Kiswahili", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ta": { - "name": "Tamil", - "nativeName": "தமிழ்", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "th": { - "name": "Thai", - "nativeName": "ไทย", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "tlh-Latn": { - "name": "Klingon (Latin)", - "nativeName": "Klingon (Latin)", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "tr": { - "name": "Turkish", - "nativeName": "Türkçe", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "uk": { - "name": "Ukrainian", - "nativeName": "Українська", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ur": { - "name": "Urdu", - "nativeName": "اردو", - "dir": "rtl", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "vi": { - "name": "Vietnamese", - "nativeName": "Tiếng Việt", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "zh-Hans": { - "name": "Chinese Simplified", - "nativeName": "中文 (简体)", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - } - } - } - }, - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Translate.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Translate.json deleted file mode 100644 index a079a1d161d2..000000000000 --- a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Translate.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_Translate", - "title": "Translate specified source language text into the target language text.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "To": "cs", - "body": [ - { - "Text": "This is a test." - } - ] - }, - "responses": { - "200": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "translations": [ - { - "text": "Tohle je test.", - "to": "cs" - } - ] - } - ], - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Transliterate.json b/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Transliterate.json deleted file mode 100644 index 519773dc34a2..000000000000 --- a/specification/translation/data-plane/text/stable/v3.0/examples/3.0/Transliterate.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_Transliterate", - "title": "Map source language script or alphabet to a target language script or alphabet.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "Language": "zh-Hans", - "FromScript": "Hans", - "ToScript": "Latn", - "body": [ - { - "Text": "这是个测试。" - } - ] - }, - "responses": { - "200": [ - { - "text": "zhè shì gè cè shì。", - "script": "Latn" - } - ], - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/data-plane/text/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json new file mode 100644 index 000000000000..06dde6ef2448 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Find Sentence Boundaries", + "operationId": "FindSentenceBoundaries", + "parameters": { + "api-version": "3.0", + "requestBody": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json new file mode 100644 index 000000000000..294302a79c49 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "operationId": "GetLanguages", + "parameters": { + "api-version": "3.0" + }, + "responses": { + "200": { + "body": {} + } + } +} \ No newline at end of file diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json new file mode 100644 index 000000000000..1c6b54e7e4eb --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json @@ -0,0 +1,86 @@ +{ + "title": "Lookup Dictionary Entries", + "operationId": "LookupDictionaryEntries", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "requestBody": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json new file mode 100644 index 000000000000..267599402c12 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json @@ -0,0 +1,43 @@ +{ + "title": "Lookup Dictionary Examples", + "operationId": "LookupDictionaryExamples", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "requestBody": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json new file mode 100644 index 000000000000..b0f1e8783a55 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Translate Text", + "operationId": "Translate", + "parameters": { + "to": [ + "fmlxpuepn" + ], + "api-version": "3.0", + "requestBody": [ + { + "Text": "This is a test." + } + ] + }, + "responses": { + "200": { + "body": [ + { + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ] + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/text/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json new file mode 100644 index 000000000000..ead6cff591f0 --- /dev/null +++ b/specification/translation/data-plane/text/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "title": "Transliterate Text", + "operationId": "Transliterate", + "parameters": { + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "requestBody": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json index 17e52e3b74b9..23e0cd0291ac 100644 --- a/specification/translation/data-plane/text/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -111,8 +111,8 @@ } }, "x-ms-examples": { - "Find Sentence Boundaries result": { - "$ref": "./examples/3.0/BreakSentence.json" + "Find Sentence Boundaries": { + "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" } } } @@ -200,8 +200,8 @@ } }, "x-ms-examples": { - "Lookup Dictionary Examples result": { - "$ref": "./examples/3.0/DictionaryExamples.json" + "Lookup Dictionary Examples": { + "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" } } } @@ -289,8 +289,8 @@ } }, "x-ms-examples": { - "Lookup Dictionary Entries result": { - "$ref": "./examples/3.0/DictionaryLookup.json" + "Lookup Dictionary Entries": { + "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" } } } @@ -358,8 +358,8 @@ } }, "x-ms-examples": { - "Get Languages result": { - "$ref": "./examples/3.0/GetLanguages.json" + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetLanguages_MinimumSet_Gen.json" } } } @@ -478,8 +478,8 @@ } }, "x-ms-examples": { - "Translate Text result": { - "$ref": "./examples/3.0/Translate.json" + "Translate Text": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" } } } @@ -562,8 +562,8 @@ } }, "x-ms-examples": { - "Transliterate Text result": { - "$ref": "./examples/3.0/Transliterate.json" + "Transliterate Text": { + "$ref": "./examples/Transliterate_MinimumSet_Gen.json" } } } @@ -1608,7 +1608,7 @@ "name": "textType", "in": "query", "required": false, - "default": "plain", + "default": "Plain", "type": "string", "enum": [ "plain", diff --git a/specification/translation/text/examples/3.0/BreakSentence.json b/specification/translation/text/examples/3.0/BreakSentence.json deleted file mode 100644 index b5633567b58a..000000000000 --- a/specification/translation/text/examples/3.0/BreakSentence.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_BreakSentence", - "title": "Returns an array of integers representing the length of sentences in a source text.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "body": [ - { - "Text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - }, - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/text/examples/3.0/DictionaryExamples.json b/specification/translation/text/examples/3.0/DictionaryExamples.json deleted file mode 100644 index 28360fce5fd3..000000000000 --- a/specification/translation/text/examples/3.0/DictionaryExamples.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_DictionaryExamples", - "title": "Returns alternatives for single word translations.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "From": "en", - "To": "es", - "body": [ - { - "Text": "fly", - "Translation": "volar" - } - ] - }, - "responses": { - "200": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ], - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/text/examples/3.0/DictionaryLookup.json b/specification/translation/text/examples/3.0/DictionaryLookup.json deleted file mode 100644 index d527b0cfd886..000000000000 --- a/specification/translation/text/examples/3.0/DictionaryLookup.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_DictionaryLookup", - "title": "Returns alternatives for single word translations.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "From": "en", - "To": "es", - "body": [ - { - "Text": "fly" - } - ] - }, - "responses": { - "200": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ], - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/text/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/text/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json new file mode 100644 index 000000000000..728c89f0d828 --- /dev/null +++ b/specification/translation/text/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json @@ -0,0 +1,28 @@ +{ + "title": "Find Sentence Boundaries", + "operationId": "FindSentenceBoundaries", + "parameters": { + "X-ClientTraceId": "svun", + "language": "en", + "script": "Latn", + "api-version": "3.0", + "requestBody": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/text/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json new file mode 100644 index 000000000000..06dde6ef2448 --- /dev/null +++ b/specification/translation/text/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Find Sentence Boundaries", + "operationId": "FindSentenceBoundaries", + "parameters": { + "api-version": "3.0", + "requestBody": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/GetLanguages.json b/specification/translation/text/examples/3.0/GetLanguages.json deleted file mode 100644 index a6d1ac627fa8..000000000000 --- a/specification/translation/text/examples/3.0/GetLanguages.json +++ /dev/null @@ -1,2665 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_GetLanguages", - "title": "Gets the set of languages currently supported by other operations of the Translator.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "body": {} - }, - "responses": { - "200": { - "body": { - "translation": { - "af": { - "name": "Afrikaans", - "nativeName": "Afrikaans", - "dir": "ltr" - }, - "am": { - "name": "Amharic", - "nativeName": "አማርኛ", - "dir": "ltr" - }, - "ar": { - "name": "Arabic", - "nativeName": "العربية", - "dir": "rtl" - }, - "as": { - "name": "Assamese", - "nativeName": "অসমীয়া", - "dir": "ltr" - }, - "az": { - "name": "Azerbaijani", - "nativeName": "Azərbaycan", - "dir": "ltr" - }, - "ba": { - "name": "Bashkir", - "nativeName": "Bashkir", - "dir": "ltr" - }, - "bg": { - "name": "Bulgarian", - "nativeName": "Български", - "dir": "ltr" - }, - "bn": { - "name": "Bangla", - "nativeName": "বাংলা", - "dir": "ltr" - }, - "bo": { - "name": "Tibetan", - "nativeName": "བོད་སྐད་", - "dir": "ltr" - }, - "bs": { - "name": "Bosnian", - "nativeName": "Bosnian", - "dir": "ltr" - }, - "ca": { - "name": "Catalan", - "nativeName": "Català", - "dir": "ltr" - }, - "cs": { - "name": "Czech", - "nativeName": "Čeština", - "dir": "ltr" - }, - "cy": { - "name": "Welsh", - "nativeName": "Cymraeg", - "dir": "ltr" - }, - "da": { - "name": "Danish", - "nativeName": "Dansk", - "dir": "ltr" - }, - "de": { - "name": "German", - "nativeName": "Deutsch", - "dir": "ltr" - }, - "dv": { - "name": "Divehi", - "nativeName": "ދިވެހިބަސް", - "dir": "rtl" - }, - "el": { - "name": "Greek", - "nativeName": "Ελληνικά", - "dir": "ltr" - }, - "en": { - "name": "English", - "nativeName": "English", - "dir": "ltr" - }, - "es": { - "name": "Spanish", - "nativeName": "Español", - "dir": "ltr" - }, - "et": { - "name": "Estonian", - "nativeName": "Eesti", - "dir": "ltr" - }, - "eu": { - "name": "Basque", - "nativeName": "Euskara", - "dir": "ltr" - }, - "fa": { - "name": "Persian", - "nativeName": "فارسی", - "dir": "rtl" - }, - "fi": { - "name": "Finnish", - "nativeName": "Suomi", - "dir": "ltr" - }, - "fil": { - "name": "Filipino", - "nativeName": "Filipino", - "dir": "ltr" - }, - "fj": { - "name": "Fijian", - "nativeName": "Na Vosa Vakaviti", - "dir": "ltr" - }, - "fo": { - "name": "Faroese", - "nativeName": "Føroyskt", - "dir": "ltr" - }, - "fr": { - "name": "French", - "nativeName": "Français", - "dir": "ltr" - }, - "fr-CA": { - "name": "French (Canada)", - "nativeName": "Français (Canada)", - "dir": "ltr" - }, - "ga": { - "name": "Irish", - "nativeName": "Gaeilge", - "dir": "ltr" - }, - "gl": { - "name": "Galician", - "nativeName": "Galego", - "dir": "ltr" - }, - "gu": { - "name": "Gujarati", - "nativeName": "ગુજરાતી", - "dir": "ltr" - }, - "he": { - "name": "Hebrew", - "nativeName": "עברית", - "dir": "rtl" - }, - "hi": { - "name": "Hindi", - "nativeName": "हिन्दी", - "dir": "ltr" - }, - "hr": { - "name": "Croatian", - "nativeName": "Hrvatski", - "dir": "ltr" - }, - "hsb": { - "name": "Upper Sorbian", - "nativeName": "Hornjoserbšćina", - "dir": "ltr" - }, - "ht": { - "name": "Haitian Creole", - "nativeName": "Haitian Creole", - "dir": "ltr" - }, - "hu": { - "name": "Hungarian", - "nativeName": "Magyar", - "dir": "ltr" - }, - "hy": { - "name": "Armenian", - "nativeName": "Հայերեն", - "dir": "ltr" - }, - "id": { - "name": "Indonesian", - "nativeName": "Indonesia", - "dir": "ltr" - }, - "ikt": { - "name": "Inuinnaqtun", - "nativeName": "Inuinnaqtun", - "dir": "ltr" - }, - "is": { - "name": "Icelandic", - "nativeName": "Íslenska", - "dir": "ltr" - }, - "it": { - "name": "Italian", - "nativeName": "Italiano", - "dir": "ltr" - }, - "iu": { - "name": "Inuktitut", - "nativeName": "ᐃᓄᒃᑎᑐᑦ", - "dir": "ltr" - }, - "iu-Latn": { - "name": "Inuktitut (Latin)", - "nativeName": "Inuktitut (Latin)", - "dir": "ltr" - }, - "ja": { - "name": "Japanese", - "nativeName": "日本語", - "dir": "ltr" - }, - "ka": { - "name": "Georgian", - "nativeName": "ქართული", - "dir": "ltr" - }, - "kk": { - "name": "Kazakh", - "nativeName": "Қазақ Тілі", - "dir": "ltr" - }, - "km": { - "name": "Khmer", - "nativeName": "ខ្មែរ", - "dir": "ltr" - }, - "kmr": { - "name": "Kurdish (Northern)", - "nativeName": "Kurdî (Bakur)", - "dir": "ltr" - }, - "kn": { - "name": "Kannada", - "nativeName": "ಕನ್ನಡ", - "dir": "ltr" - }, - "ko": { - "name": "Korean", - "nativeName": "한국어", - "dir": "ltr" - }, - "ku": { - "name": "Kurdish (Central)", - "nativeName": "Kurdî (Navîn)", - "dir": "rtl" - }, - "ky": { - "name": "Kyrgyz", - "nativeName": "Кыргызча", - "dir": "ltr" - }, - "lo": { - "name": "Lao", - "nativeName": "ລາວ", - "dir": "ltr" - }, - "lt": { - "name": "Lithuanian", - "nativeName": "Lietuvių", - "dir": "ltr" - }, - "lv": { - "name": "Latvian", - "nativeName": "Latviešu", - "dir": "ltr" - }, - "lzh": { - "name": "Chinese (Literary)", - "nativeName": "中文 (文言文)", - "dir": "ltr" - }, - "mg": { - "name": "Malagasy", - "nativeName": "Malagasy", - "dir": "ltr" - }, - "mi": { - "name": "Māori", - "nativeName": "Te Reo Māori", - "dir": "ltr" - }, - "mk": { - "name": "Macedonian", - "nativeName": "Македонски", - "dir": "ltr" - }, - "ml": { - "name": "Malayalam", - "nativeName": "മലയാളം", - "dir": "ltr" - }, - "mn-Cyrl": { - "name": "Mongolian (Cyrillic)", - "nativeName": "Mongolian (Cyrillic)", - "dir": "ltr" - }, - "mn-Mong": { - "name": "Mongolian (Traditional)", - "nativeName": "ᠮᠣᠩᠭᠣᠯ ᠬᠡᠯᠡ", - "dir": "ltr" - }, - "mr": { - "name": "Marathi", - "nativeName": "मराठी", - "dir": "ltr" - }, - "ms": { - "name": "Malay", - "nativeName": "Melayu", - "dir": "ltr" - }, - "mt": { - "name": "Maltese", - "nativeName": "Malti", - "dir": "ltr" - }, - "mww": { - "name": "Hmong Daw", - "nativeName": "Hmong Daw", - "dir": "ltr" - }, - "my": { - "name": "Myanmar (Burmese)", - "nativeName": "မြန်မာ", - "dir": "ltr" - }, - "nb": { - "name": "Norwegian", - "nativeName": "Norsk Bokmål", - "dir": "ltr" - }, - "ne": { - "name": "Nepali", - "nativeName": "नेपाली", - "dir": "ltr" - }, - "nl": { - "name": "Dutch", - "nativeName": "Nederlands", - "dir": "ltr" - }, - "or": { - "name": "Odia", - "nativeName": "ଓଡ଼ିଆ", - "dir": "ltr" - }, - "otq": { - "name": "Querétaro Otomi", - "nativeName": "Hñähñu", - "dir": "ltr" - }, - "pa": { - "name": "Punjabi", - "nativeName": "ਪੰਜਾਬੀ", - "dir": "ltr" - }, - "pl": { - "name": "Polish", - "nativeName": "Polski", - "dir": "ltr" - }, - "prs": { - "name": "Dari", - "nativeName": "دری", - "dir": "rtl" - }, - "ps": { - "name": "Pashto", - "nativeName": "پښتو", - "dir": "rtl" - }, - "pt": { - "name": "Portuguese (Brazil)", - "nativeName": "Português (Brasil)", - "dir": "ltr" - }, - "pt-PT": { - "name": "Portuguese (Portugal)", - "nativeName": "Português (Portugal)", - "dir": "ltr" - }, - "ro": { - "name": "Romanian", - "nativeName": "Română", - "dir": "ltr" - }, - "ru": { - "name": "Russian", - "nativeName": "Русский", - "dir": "ltr" - }, - "sk": { - "name": "Slovak", - "nativeName": "Slovenčina", - "dir": "ltr" - }, - "sl": { - "name": "Slovenian", - "nativeName": "Slovenščina", - "dir": "ltr" - }, - "sm": { - "name": "Samoan", - "nativeName": "Gagana Sāmoa", - "dir": "ltr" - }, - "so": { - "name": "Somali", - "nativeName": "Soomaali", - "dir": "ltr" - }, - "sq": { - "name": "Albanian", - "nativeName": "Shqip", - "dir": "ltr" - }, - "sr-Cyrl": { - "name": "Serbian (Cyrillic)", - "nativeName": "Српски (ћирилица)", - "dir": "ltr" - }, - "sr-Latn": { - "name": "Serbian (Latin)", - "nativeName": "Srpski (latinica)", - "dir": "ltr" - }, - "sv": { - "name": "Swedish", - "nativeName": "Svenska", - "dir": "ltr" - }, - "sw": { - "name": "Swahili", - "nativeName": "Kiswahili", - "dir": "ltr" - }, - "ta": { - "name": "Tamil", - "nativeName": "தமிழ்", - "dir": "ltr" - }, - "te": { - "name": "Telugu", - "nativeName": "తెలుగు", - "dir": "ltr" - }, - "th": { - "name": "Thai", - "nativeName": "ไทย", - "dir": "ltr" - }, - "ti": { - "name": "Tigrinya", - "nativeName": "ትግር", - "dir": "ltr" - }, - "tk": { - "name": "Turkmen", - "nativeName": "Türkmen Dili", - "dir": "ltr" - }, - "tlh-Latn": { - "name": "Klingon (Latin)", - "nativeName": "Klingon (Latin)", - "dir": "ltr" - }, - "tlh-Piqd": { - "name": "Klingon (pIqaD)", - "nativeName": "Klingon (pIqaD)", - "dir": "ltr" - }, - "to": { - "name": "Tongan", - "nativeName": "Lea Fakatonga", - "dir": "ltr" - }, - "tr": { - "name": "Turkish", - "nativeName": "Türkçe", - "dir": "ltr" - }, - "tt": { - "name": "Tatar", - "nativeName": "Татар", - "dir": "ltr" - }, - "ty": { - "name": "Tahitian", - "nativeName": "Reo Tahiti", - "dir": "ltr" - }, - "ug": { - "name": "Uyghur", - "nativeName": "ئۇيغۇرچە", - "dir": "rtl" - }, - "uk": { - "name": "Ukrainian", - "nativeName": "Українська", - "dir": "ltr" - }, - "ur": { - "name": "Urdu", - "nativeName": "اردو", - "dir": "rtl" - }, - "uz": { - "name": "Uzbek (Latin)", - "nativeName": "Uzbek (Latin)", - "dir": "ltr" - }, - "vi": { - "name": "Vietnamese", - "nativeName": "Tiếng Việt", - "dir": "ltr" - }, - "yua": { - "name": "Yucatec Maya", - "nativeName": "Yucatec Maya", - "dir": "ltr" - }, - "yue": { - "name": "Cantonese (Traditional)", - "nativeName": "粵語 (繁體)", - "dir": "ltr" - }, - "zh-Hans": { - "name": "Chinese Simplified", - "nativeName": "中文 (简体)", - "dir": "ltr" - }, - "zh-Hant": { - "name": "Chinese Traditional", - "nativeName": "繁體中文 (繁體)", - "dir": "ltr" - }, - "zu": { - "name": "Zulu", - "nativeName": "Isi-Zulu", - "dir": "ltr" - } - }, - "transliteration": { - "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" - } - ] - } - ] - }, - "be": { - "name": "Belarusian", - "nativeName": "Belarusian", - "scripts": [ - { - "code": "Cyrl", - "name": "Cyrillic", - "nativeName": "Cyrillic", - "dir": "ltr", - "toScripts": [ - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr" - } - ] - }, - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr", - "toScripts": [ - { - "code": "Cyrl", - "name": "Cyrillic", - "nativeName": "Cyrillic", - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "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" - } - ] - } - ] - }, - "sd": { - "name": "Sindhi", - "nativeName": "سنڌي", - "scripts": [ - { - "code": "Arab", - "name": "Arabic", - "nativeName": "Arabic", - "dir": "ltr", - "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": "ltr" - } - ] - } - ] - }, - "si": { - "name": "Sinhala", - "nativeName": "සිංහල", - "scripts": [ - { - "code": "Sinh", - "name": "Sinhala", - "nativeName": "Sinhala", - "dir": "ltr", - "toScripts": [ - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr" - } - ] - }, - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr", - "toScripts": [ - { - "code": "Sinh", - "name": "Sinhala", - "nativeName": "Sinhala", - "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": "Cyrillic", - "dir": "ltr", - "toScripts": [ - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr" - } - ] - }, - { - "code": "Latn", - "name": "Latin", - "nativeName": "Latin", - "dir": "ltr", - "toScripts": [ - { - "code": "Cyrl", - "name": "Cyrillic", - "nativeName": "Cyrillic", - "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" - } - ] - } - ] - } - }, - "dictionary": { - "af": { - "name": "Afrikaans", - "nativeName": "Afrikaans", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ar": { - "name": "Arabic", - "nativeName": "العربية", - "dir": "rtl", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "bg": { - "name": "Bulgarian", - "nativeName": "Български", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "bn": { - "name": "Bangla", - "nativeName": "বাংলা", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "bs": { - "name": "Bosnian", - "nativeName": "Bosnian", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ca": { - "name": "Catalan", - "nativeName": "Català", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "cs": { - "name": "Czech", - "nativeName": "Čeština", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "cy": { - "name": "Welsh", - "nativeName": "Cymraeg", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "da": { - "name": "Danish", - "nativeName": "Dansk", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "de": { - "name": "German", - "nativeName": "Deutsch", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "el": { - "name": "Greek", - "nativeName": "Ελληνικά", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "en": { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "translations": [ - { - "name": "Afrikaans", - "nativeName": "Afrikaans", - "dir": "ltr", - "code": "af" - }, - { - "name": "Arabic", - "nativeName": "العربية", - "dir": "rtl", - "code": "ar" - }, - { - "name": "Bulgarian", - "nativeName": "Български", - "dir": "ltr", - "code": "bg" - }, - { - "name": "Bangla", - "nativeName": "বাংলা", - "dir": "ltr", - "code": "bn" - }, - { - "name": "Bosnian", - "nativeName": "Bosnian", - "dir": "ltr", - "code": "bs" - }, - { - "name": "Catalan", - "nativeName": "Català", - "dir": "ltr", - "code": "ca" - }, - { - "name": "Chinese Simplified", - "nativeName": "中文 (简体)", - "dir": "ltr", - "code": "zh-Hans" - }, - { - "name": "Czech", - "nativeName": "Čeština", - "dir": "ltr", - "code": "cs" - }, - { - "name": "Welsh", - "nativeName": "Cymraeg", - "dir": "ltr", - "code": "cy" - }, - { - "name": "Danish", - "nativeName": "Dansk", - "dir": "ltr", - "code": "da" - }, - { - "name": "German", - "nativeName": "Deutsch", - "dir": "ltr", - "code": "de" - }, - { - "name": "Greek", - "nativeName": "Ελληνικά", - "dir": "ltr", - "code": "el" - }, - { - "name": "Spanish", - "nativeName": "Español", - "dir": "ltr", - "code": "es" - }, - { - "name": "Estonian", - "nativeName": "Eesti", - "dir": "ltr", - "code": "et" - }, - { - "name": "Persian", - "nativeName": "فارسی", - "dir": "rtl", - "code": "fa" - }, - { - "name": "Finnish", - "nativeName": "Suomi", - "dir": "ltr", - "code": "fi" - }, - { - "name": "French", - "nativeName": "Français", - "dir": "ltr", - "code": "fr" - }, - { - "name": "Hebrew", - "nativeName": "עברית", - "dir": "rtl", - "code": "he" - }, - { - "name": "Hindi", - "nativeName": "हिन्दी", - "dir": "ltr", - "code": "hi" - }, - { - "name": "Croatian", - "nativeName": "Hrvatski", - "dir": "ltr", - "code": "hr" - }, - { - "name": "Hungarian", - "nativeName": "Magyar", - "dir": "ltr", - "code": "hu" - }, - { - "name": "Indonesian", - "nativeName": "Indonesia", - "dir": "ltr", - "code": "id" - }, - { - "name": "Icelandic", - "nativeName": "Íslenska", - "dir": "ltr", - "code": "is" - }, - { - "name": "Italian", - "nativeName": "Italiano", - "dir": "ltr", - "code": "it" - }, - { - "name": "Japanese", - "nativeName": "日本語", - "dir": "ltr", - "code": "ja" - }, - { - "name": "Korean", - "nativeName": "한국어", - "dir": "ltr", - "code": "ko" - }, - { - "name": "Lithuanian", - "nativeName": "Lietuvių", - "dir": "ltr", - "code": "lt" - }, - { - "name": "Latvian", - "nativeName": "Latviešu", - "dir": "ltr", - "code": "lv" - }, - { - "name": "Maltese", - "nativeName": "Malti", - "dir": "ltr", - "code": "mt" - }, - { - "name": "Malay", - "nativeName": "Melayu", - "dir": "ltr", - "code": "ms" - }, - { - "name": "Hmong Daw", - "nativeName": "Hmong Daw", - "dir": "ltr", - "code": "mww" - }, - { - "name": "Dutch", - "nativeName": "Nederlands", - "dir": "ltr", - "code": "nl" - }, - { - "name": "Norwegian", - "nativeName": "Norsk Bokmål", - "dir": "ltr", - "code": "nb" - }, - { - "name": "Polish", - "nativeName": "Polski", - "dir": "ltr", - "code": "pl" - }, - { - "name": "Portuguese (Brazil)", - "nativeName": "Português (Brasil)", - "dir": "ltr", - "code": "pt" - }, - { - "name": "Romanian", - "nativeName": "Română", - "dir": "ltr", - "code": "ro" - }, - { - "name": "Russian", - "nativeName": "Русский", - "dir": "ltr", - "code": "ru" - }, - { - "name": "Slovak", - "nativeName": "Slovenčina", - "dir": "ltr", - "code": "sk" - }, - { - "name": "Slovenian", - "nativeName": "Slovenščina", - "dir": "ltr", - "code": "sl" - }, - { - "name": "Serbian (Latin)", - "nativeName": "Srpski (latinica)", - "dir": "ltr", - "code": "sr-Latn" - }, - { - "name": "Swedish", - "nativeName": "Svenska", - "dir": "ltr", - "code": "sv" - }, - { - "name": "Swahili", - "nativeName": "Kiswahili", - "dir": "ltr", - "code": "sw" - }, - { - "name": "Tamil", - "nativeName": "தமிழ்", - "dir": "ltr", - "code": "ta" - }, - { - "name": "Thai", - "nativeName": "ไทย", - "dir": "ltr", - "code": "th" - }, - { - "name": "Klingon (Latin)", - "nativeName": "Klingon (Latin)", - "dir": "ltr", - "code": "tlh-Latn" - }, - { - "name": "Turkish", - "nativeName": "Türkçe", - "dir": "ltr", - "code": "tr" - }, - { - "name": "Ukrainian", - "nativeName": "Українська", - "dir": "ltr", - "code": "uk" - }, - { - "name": "Urdu", - "nativeName": "اردو", - "dir": "rtl", - "code": "ur" - }, - { - "name": "Vietnamese", - "nativeName": "Tiếng Việt", - "dir": "ltr", - "code": "vi" - } - ] - }, - "es": { - "name": "Spanish", - "nativeName": "Español", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "et": { - "name": "Estonian", - "nativeName": "Eesti", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "fa": { - "name": "Persian", - "nativeName": "فارسی", - "dir": "rtl", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "fi": { - "name": "Finnish", - "nativeName": "Suomi", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "fr": { - "name": "French", - "nativeName": "Français", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "he": { - "name": "Hebrew", - "nativeName": "עברית", - "dir": "rtl", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "hi": { - "name": "Hindi", - "nativeName": "हिन्दी", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "hr": { - "name": "Croatian", - "nativeName": "Hrvatski", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "hu": { - "name": "Hungarian", - "nativeName": "Magyar", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "id": { - "name": "Indonesian", - "nativeName": "Indonesia", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "is": { - "name": "Icelandic", - "nativeName": "Íslenska", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "it": { - "name": "Italian", - "nativeName": "Italiano", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ja": { - "name": "Japanese", - "nativeName": "日本語", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ko": { - "name": "Korean", - "nativeName": "한국어", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "lt": { - "name": "Lithuanian", - "nativeName": "Lietuvių", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "lv": { - "name": "Latvian", - "nativeName": "Latviešu", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ms": { - "name": "Malay", - "nativeName": "Melayu", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "mt": { - "name": "Maltese", - "nativeName": "Malti", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "mww": { - "name": "Hmong Daw", - "nativeName": "Hmong Daw", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "nb": { - "name": "Norwegian", - "nativeName": "Norsk Bokmål", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "nl": { - "name": "Dutch", - "nativeName": "Nederlands", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "pl": { - "name": "Polish", - "nativeName": "Polski", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "pt": { - "name": "Portuguese (Brazil)", - "nativeName": "Português (Brasil)", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ro": { - "name": "Romanian", - "nativeName": "Română", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ru": { - "name": "Russian", - "nativeName": "Русский", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sk": { - "name": "Slovak", - "nativeName": "Slovenčina", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sl": { - "name": "Slovenian", - "nativeName": "Slovenščina", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sr-Latn": { - "name": "Serbian (Latin)", - "nativeName": "Srpski (latinica)", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sv": { - "name": "Swedish", - "nativeName": "Svenska", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "sw": { - "name": "Swahili", - "nativeName": "Kiswahili", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ta": { - "name": "Tamil", - "nativeName": "தமிழ்", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "th": { - "name": "Thai", - "nativeName": "ไทย", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "tlh-Latn": { - "name": "Klingon (Latin)", - "nativeName": "Klingon (Latin)", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "tr": { - "name": "Turkish", - "nativeName": "Türkçe", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "uk": { - "name": "Ukrainian", - "nativeName": "Українська", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "ur": { - "name": "Urdu", - "nativeName": "اردو", - "dir": "rtl", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "vi": { - "name": "Vietnamese", - "nativeName": "Tiếng Việt", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - }, - "zh-Hans": { - "name": "Chinese Simplified", - "nativeName": "中文 (简体)", - "dir": "ltr", - "translations": [ - { - "name": "English", - "nativeName": "English", - "dir": "ltr", - "code": "en" - } - ] - } - } - } - }, - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/text/examples/3.0/GetLanguages_MaximumSet_Gen.json b/specification/translation/text/examples/3.0/GetLanguages_MaximumSet_Gen.json new file mode 100644 index 000000000000..901ca0112979 --- /dev/null +++ b/specification/translation/text/examples/3.0/GetLanguages_MaximumSet_Gen.json @@ -0,0 +1,80 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "operationId": "GetLanguages", + "parameters": { + "X-ClientTraceId": "kayfnugjec", + "scope": "translation,transliteration,dictionary", + "Accept-Language": "en", + "If-None-Match": "fpnhruttllvc", + "api-version": "3.0" + }, + "responses": { + "200": { + "body": { + "translation": { + "en": { + "name": "English", + "nativeName": "English", + "dir": "ltr" + }, + "es": { + "name": "Spanish", + "nativeName": "Español", + "dir": "ltr" + } + }, + "transliteration": { + "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" + } + ] + } + ] + } + }, + "dictionary": { + "cs": { + "name": "Czech", + "nativeName": "Čeština", + "dir": "ltr", + "translations": [ + { + "name": "English", + "nativeName": "English", + "dir": "ltr", + "code": "en" + } + ] + } + } + } + } + } +} diff --git a/specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json b/specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json new file mode 100644 index 000000000000..294302a79c49 --- /dev/null +++ b/specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "operationId": "GetLanguages", + "parameters": { + "api-version": "3.0" + }, + "responses": { + "200": { + "body": {} + } + } +} \ No newline at end of file diff --git a/specification/translation/text/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/text/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json new file mode 100644 index 000000000000..1da1ee01cd31 --- /dev/null +++ b/specification/translation/text/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json @@ -0,0 +1,87 @@ +{ + "title": "Lookup Dictionary Entries", + "operationId": "LookupDictionaryEntries", + "parameters": { + "X-ClientTraceId": "yqst", + "from": "en", + "to": "es", + "api-version": "3.0", + "requestBody": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/text/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json new file mode 100644 index 000000000000..1c6b54e7e4eb --- /dev/null +++ b/specification/translation/text/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json @@ -0,0 +1,86 @@ +{ + "title": "Lookup Dictionary Entries", + "operationId": "LookupDictionaryEntries", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "requestBody": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/text/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json new file mode 100644 index 000000000000..328ba8cbe79e --- /dev/null +++ b/specification/translation/text/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json @@ -0,0 +1,44 @@ +{ + "title": "Lookup Dictionary Examples", + "operationId": "LookupDictionaryExamples", + "parameters": { + "X-ClientTraceId": "vykwwekvcncclrmsyjhbok", + "from": "en", + "to": "es", + "api-version": "3.0", + "requestBody": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/text/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json new file mode 100644 index 000000000000..267599402c12 --- /dev/null +++ b/specification/translation/text/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json @@ -0,0 +1,43 @@ +{ + "title": "Lookup Dictionary Examples", + "operationId": "LookupDictionaryExamples", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "requestBody": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/Translate.json b/specification/translation/text/examples/3.0/Translate.json deleted file mode 100644 index a079a1d161d2..000000000000 --- a/specification/translation/text/examples/3.0/Translate.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_Translate", - "title": "Translate specified source language text into the target language text.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "To": "cs", - "body": [ - { - "Text": "This is a test." - } - ] - }, - "responses": { - "200": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "translations": [ - { - "text": "Tohle je test.", - "to": "cs" - } - ] - } - ], - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/text/examples/3.0/Translate_MaximumSet_Gen.json b/specification/translation/text/examples/3.0/Translate_MaximumSet_Gen.json new file mode 100644 index 000000000000..88c313fa9ec8 --- /dev/null +++ b/specification/translation/text/examples/3.0/Translate_MaximumSet_Gen.json @@ -0,0 +1,63 @@ +{ + "title": "Translate Text", + "operationId": "Translate", + "parameters": { + "X-ClientTraceId": "ndbkaatzsnoetqkiehappoza", + "to": [ + "cs" + ], + "from": "en", + "textType": "plain", + "category": "custom", + "profanityAction": "NoAction", + "profanityMarker": "Asterisk", + "includeAlignment": true, + "includeSentenceLength": true, + "suggestedFrom": "en", + "fromScript": "Latn", + "toScript": "Latn", + "allowFallback": true, + "api-version": "3.0", + "requestBody": [ + { + "text": "This is a test." + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "translations": [ + { + "to": "cs", + "text": "Tohle je test.", + "transliteration": { + "text": "Tohle je test.", + "script": "Latn" + }, + "alignment": { + "proj": "okrxvzsagjgzrrv" + }, + "sentLen": { + "srcSentLen": [ + 30 + ], + "transSentLen": [ + 24 + ] + } + } + ], + "sourceText": { + "text": "This is a test" + } + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json b/specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json new file mode 100644 index 000000000000..b0f1e8783a55 --- /dev/null +++ b/specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Translate Text", + "operationId": "Translate", + "parameters": { + "to": [ + "fmlxpuepn" + ], + "api-version": "3.0", + "requestBody": [ + { + "Text": "This is a test." + } + ] + }, + "responses": { + "200": { + "body": [ + { + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/Transliterate.json b/specification/translation/text/examples/3.0/Transliterate.json deleted file mode 100644 index 519773dc34a2..000000000000 --- a/specification/translation/text/examples/3.0/Transliterate.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "operationId": "Translator_TextTranslation_Transliterate", - "title": "Map source language script or alphabet to a target language script or alphabet.", - "parameters": { - "Endpoint": "{Endpoint}", - "ApiVersion": "v3.0", - "Content-Type": "application/json", - "Language": "zh-Hans", - "FromScript": "Hans", - "ToScript": "Latn", - "body": [ - { - "Text": "这是个测试。" - } - ] - }, - "responses": { - "200": [ - { - "text": "zhè shì gè cè shì。", - "script": "Latn" - } - ], - "default": { - "headers": { - "Content-Type": "application/json", - "x-requestid": "Request id for tracing" - }, - "body": { - "error": { - "code": 400000, - "message": "Error Message" - } - } - } - } -} diff --git a/specification/translation/text/examples/3.0/Transliterate_MaximumSet_Gen.json b/specification/translation/text/examples/3.0/Transliterate_MaximumSet_Gen.json new file mode 100644 index 000000000000..98b0d124990f --- /dev/null +++ b/specification/translation/text/examples/3.0/Transliterate_MaximumSet_Gen.json @@ -0,0 +1,26 @@ +{ + "title": "Transliterate Text", + "operationId": "Transliterate", + "parameters": { + "X-ClientTraceId": "dzncrimwmvtwjnheh", + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "requestBody": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/text/examples/3.0/Transliterate_MinimumSet_Gen.json b/specification/translation/text/examples/3.0/Transliterate_MinimumSet_Gen.json new file mode 100644 index 000000000000..ead6cff591f0 --- /dev/null +++ b/specification/translation/text/examples/3.0/Transliterate_MinimumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "title": "Transliterate Text", + "operationId": "Transliterate", + "parameters": { + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "requestBody": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json new file mode 100644 index 000000000000..06dde6ef2448 --- /dev/null +++ b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Find Sentence Boundaries", + "operationId": "FindSentenceBoundaries", + "parameters": { + "api-version": "3.0", + "requestBody": [ + { + "text": "How are you? I am fine. What did you do today?" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "detectedLanguage": { + "language": "en", + "score": 1.0 + }, + "sentLen": [ + 13, + 11, + 22 + ] + } + ] + } + } +} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json new file mode 100644 index 000000000000..294302a79c49 --- /dev/null +++ b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json @@ -0,0 +1,12 @@ +{ + "title": "Gets the set of languages currently supported by other operations of the Translator.", + "operationId": "GetLanguages", + "parameters": { + "api-version": "3.0" + }, + "responses": { + "200": { + "body": {} + } + } +} \ No newline at end of file diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json new file mode 100644 index 000000000000..1c6b54e7e4eb --- /dev/null +++ b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json @@ -0,0 +1,86 @@ +{ + "title": "Lookup Dictionary Entries", + "operationId": "LookupDictionaryEntries", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "requestBody": [ + { + "text": "fly" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "displaySource": "fly", + "translations": [ + { + "normalizedTarget": "volar", + "displayTarget": "volar", + "posTag": "VERB", + "confidence": 0.4081, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 4637 + }, + { + "normalizedText": "flying", + "displayText": "flying", + "numExamples": 15, + "frequencyCount": 1365 + }, + { + "normalizedText": "blow", + "displayText": "blow", + "numExamples": 15, + "frequencyCount": 503 + }, + { + "normalizedText": "flight", + "displayText": "flight", + "numExamples": 15, + "frequencyCount": 135 + } + ] + }, + { + "normalizedTarget": "mosca", + "displayTarget": "mosca", + "posTag": "NOUN", + "confidence": 0.2668, + "prefixWord": "", + "backTranslations": [ + { + "normalizedText": "fly", + "displayText": "fly", + "numExamples": 15, + "frequencyCount": 1697 + }, + { + "normalizedText": "flyweight", + "displayText": "flyweight", + "numExamples": 0, + "frequencyCount": 48 + }, + { + "normalizedText": "flies", + "displayText": "flies", + "numExamples": 9, + "frequencyCount": 34 + } + ] + } + ] + } + ] + } + } +} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json new file mode 100644 index 000000000000..267599402c12 --- /dev/null +++ b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json @@ -0,0 +1,43 @@ +{ + "title": "Lookup Dictionary Examples", + "operationId": "LookupDictionaryExamples", + "parameters": { + "from": "en", + "to": "es", + "api-version": "3.0", + "requestBody": [ + { + "text": "fly", + "translation": "volar" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "normalizedSource": "fly", + "normalizedTarget": "volar", + "examples": [ + { + "sourcePrefix": "They need machines to ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Necesitan máquinas para ", + "targetTerm": "volar", + "targetSuffix": "." + }, + { + "sourcePrefix": "That should really ", + "sourceTerm": "fly", + "sourceSuffix": ".", + "targetPrefix": "Eso realmente debe ", + "targetTerm": "volar", + "targetSuffix": "." + } + ] + } + ] + } + } +} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Translate_MinimumSet_Gen.json new file mode 100644 index 000000000000..b0f1e8783a55 --- /dev/null +++ b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Translate_MinimumSet_Gen.json @@ -0,0 +1,29 @@ +{ + "title": "Translate Text", + "operationId": "Translate", + "parameters": { + "to": [ + "fmlxpuepn" + ], + "api-version": "3.0", + "requestBody": [ + { + "Text": "This is a test." + } + ] + }, + "responses": { + "200": { + "body": [ + { + "translations": [ + { + "text": "Tohle je test.", + "to": "cs" + } + ] + } + ] + } + } +} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Transliterate_MinimumSet_Gen.json new file mode 100644 index 000000000000..ead6cff591f0 --- /dev/null +++ b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Transliterate_MinimumSet_Gen.json @@ -0,0 +1,25 @@ +{ + "title": "Transliterate Text", + "operationId": "Transliterate", + "parameters": { + "language": "zh-Hans", + "fromScript": "Hans", + "toScript": "Latn", + "api-version": "3.0", + "requestBody": [ + { + "text": "这是个测试。" + } + ] + }, + "responses": { + "200": { + "body": [ + { + "text": "zhè shì gè cè shì。", + "script": "Latn" + } + ] + } + } +} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/openapi.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/openapi.json new file mode 100644 index 000000000000..23e0cd0291ac --- /dev/null +++ b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/openapi.json @@ -0,0 +1,1678 @@ +{ + "swagger": "2.0", + "info": { + "title": "Text Translation", + "version": "3.0", + "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.\n\nDictionary lookup. Returns equivalent words for the source term in the target language.\n\nDictionary example Returns grammatical structure and context examples for the source term and target term pair.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "Endpoint", + "in": "path", + "required": true, + "description": "Supported Text Translation endpoints (protocol and hostname, for example:\n https://api.cognitive.microsofttranslator.com).", + "type": "string", + "format": "uri", + "x-ms-skip-url-encoding": true + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": { + "/breaksentence": { + "post": { + "operationId": "FindSentenceBoundaries", + "summary": "Find Sentence Boundaries", + "description": "Find Sentence Boundaries", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.language" + }, + { + "$ref": "#/parameters/BreakSentenceParameters.script" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "description": "Mandatory API version parameter", + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + } + } + ], + "responses": { + "200": { + "description": "Response for the Break SEntence API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "BreakSentenceItem[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Find Sentence Boundaries": { + "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" + } + } + } + }, + "/dictionary/examples": { + "post": { + "operationId": "LookupDictionaryExamples", + "summary": "Lookup Dictionary Examples", + "description": "Lookup Dictionary Examples", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "name": "from", + "in": "query", + "required": true, + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", + "type": "string" + }, + { + "name": "to", + "in": "query", + "required": true, + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", + "type": "string" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "description": "Mandatory API version parameter", + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExampleTextItem[]" + } + } + ], + "responses": { + "200": { + "description": "Response for the dictionary examples API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExampleItem[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Lookup Dictionary Examples": { + "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" + } + } + } + }, + "/dictionary/lookup": { + "post": { + "operationId": "LookupDictionaryEntries", + "summary": "Lookup Dictionary Entries", + "description": "Lookup Dictionary Entries", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "name": "from", + "in": "query", + "required": true, + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", + "type": "string" + }, + { + "name": "to", + "in": "query", + "required": true, + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", + "type": "string" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "description": "Mandatory API version parameter", + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + } + } + ], + "responses": { + "200": { + "description": "Response for the dictionary lookup API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryLookupItem[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Lookup Dictionary Entries": { + "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" + } + } + } + }, + "/languages": { + "get": { + "operationId": "GetLanguages", + "summary": "Gets the set of languages currently supported by other operations of the Translator.", + "description": "Gets the set of languages currently supported by other operations of the Translator.", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "$ref": "#/parameters/GetLanguageParameters.scope" + }, + { + "$ref": "#/parameters/GetLanguageParameters.acceptLanguage" + }, + { + "$ref": "#/parameters/GetLanguageParameters.ifNoneMatch" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "description": "Mandatory API version parameter", + "x-ms-client-name": "apiVersion", + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + }, + "ETag": { + "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/GetLanguagesResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Gets the set of languages currently supported by other operations of the Translator.": { + "$ref": "./examples/GetLanguages_MinimumSet_Gen.json" + } + } + } + }, + "/translate": { + "post": { + "operationId": "Translate", + "summary": "Translate Text", + "description": "Translate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "$ref": "#/parameters/TranslateParameters.to" + }, + { + "$ref": "#/parameters/TranslateParameters.from" + }, + { + "$ref": "#/parameters/TranslateParameters.textType" + }, + { + "$ref": "#/parameters/TranslateParameters.category" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityAction" + }, + { + "$ref": "#/parameters/TranslateParameters.profanityMarker" + }, + { + "$ref": "#/parameters/TranslateParameters.includeAlignment" + }, + { + "$ref": "#/parameters/TranslateParameters.includeSentenceLength" + }, + { + "$ref": "#/parameters/TranslateParameters.suggestedFrom" + }, + { + "$ref": "#/parameters/TranslateParameters.fromScript" + }, + { + "$ref": "#/parameters/TranslateParameters.toScript" + }, + { + "$ref": "#/parameters/TranslateParameters.allowFallback" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "description": "Mandatory API version parameter", + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + } + } + ], + "responses": { + "200": { + "description": "Response for the translation API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + }, + "x-mt-system": { + "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests", + "type": "string" + }, + "x-metered-usage": { + "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'.", + "type": "integer", + "format": "int32" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TranslatedTextItem[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Translate Text": { + "$ref": "./examples/Translate_MinimumSet_Gen.json" + } + } + } + }, + "/transliterate": { + "post": { + "operationId": "Transliterate", + "summary": "Transliterate Text", + "description": "Transliterate Text", + "parameters": [ + { + "name": "X-ClientTraceId", + "in": "header", + "required": false, + "description": "A client-generated GUID to uniquely identify the request.", + "x-ms-client-name": "clientTraceId", + "type": "string" + }, + { + "$ref": "#/parameters/TransliterateParameters.language" + }, + { + "$ref": "#/parameters/TransliterateParameters.fromScript" + }, + { + "$ref": "#/parameters/TransliterateParameters.toScript" + }, + { + "name": "api-version", + "in": "query", + "required": true, + "description": "Mandatory API version parameter", + "x-ms-client-name": "apiVersion", + "type": "string" + }, + { + "name": "requestBody", + "in": "body", + "required": true, + "description": "Defines the content of the request", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/InputTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "InputTextItem[]" + } + } + ], + "responses": { + "200": { + "description": "Response for the transliteration API.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TransliteratedText" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TransliteratedText[]" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "X-RequestId": { + "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Transliterate Text": { + "$ref": "./examples/Transliterate_MinimumSet_Gen.json" + } + } + } + } + }, + "definitions": { + "APIVersion": { + "type": "string", + "description": "Text Translation supported versions", + "enum": [ + "3.0" + ], + "x-ms-enum": { + "name": "APIVersion", + "modelAsString": true, + "values": [ + { + "name": "v3_0", + "value": "3.0" + } + ] + } + }, + "BackTranslation": { + "type": "object", + "properties": { + "normalizedText": { + "type": "string", + "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." + }, + "displayText": { + "type": "string", + "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." + }, + "numExamples": { + "type": "integer", + "format": "int32", + "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." + }, + "frequencyCount": { + "type": "integer", + "format": "int32", + "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." + } + }, + "description": "Back Translation", + "required": [ + "normalizedText", + "displayText", + "numExamples", + "frequencyCount" + ] + }, + "BreakSentenceItem": { + "type": "object", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "sentLen": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "x-typespec-name": "int32[]", + "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence." + } + }, + "description": "Item containing break sentence result.", + "required": [ + "sentLen" + ] + }, + "BreakSentenceResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/BreakSentenceItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "BreakSentenceItem[]", + "description": "Array of the break sentence elements." + } + }, + "description": "Response for the Break SEntence API.", + "required": [ + "result" + ] + }, + "CommonScriptModel": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Code identifying the script." + }, + "name": { + "type": "string", + "description": "Display name of the script in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for the language." + }, + "dir": { + "type": "string", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + } + }, + "description": "Common properties of language script", + "required": [ + "code", + "name", + "nativeName", + "dir" + ] + }, + "DetectedLanguage": { + "type": "object", + "properties": { + "language": { + "type": "string", + "description": "A string representing the code of the detected language." + }, + "score": { + "type": "number", + "format": "float", + "description": "A float value indicating the confidence in the result.\nThe score is between zero and one and a low score indicates a low confidence." + } + }, + "description": "An object describing the detected language.", + "required": [ + "language", + "score" + ] + }, + "DictionaryExample": { + "type": "object", + "properties": { + "sourcePrefix": { + "type": "string", + "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "sourceTerm": { + "type": "string", + "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." + }, + "sourceSuffix": { + "type": "string", + "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." + }, + "targetPrefix": { + "type": "string", + "description": "A string similar to sourcePrefix but for the target." + }, + "targetTerm": { + "type": "string", + "description": "A string similar to sourceTerm but for the target." + }, + "targetSuffix": { + "type": "string", + "description": "A string similar to sourceSuffix but for the target." + } + }, + "description": "Dictionary Example", + "required": [ + "sourcePrefix", + "sourceTerm", + "sourceSuffix", + "targetPrefix", + "targetTerm", + "targetSuffix" + ] + }, + "DictionaryExampleItem": { + "type": "object", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." + }, + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." + }, + "examples": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExample" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExample[]", + "description": "A list of examples for the (source term, target term) pair." + } + }, + "description": "Dictionary Example element", + "required": [ + "normalizedSource", + "normalizedTarget", + "examples" + ] + }, + "DictionaryExampleTextItem": { + "type": "object", + "properties": { + "translation": { + "type": "string", + "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." + } + }, + "description": "Element containing the text with translation.", + "required": [ + "translation" + ], + "allOf": [ + { + "$ref": "#/definitions/InputTextItem" + } + ] + }, + "DictionaryExamplesParameters": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." + }, + "to": { + "type": "string", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." + } + }, + "description": "Request parameters for the dictionary examples API.", + "required": [ + "from", + "to" + ] + }, + "DictionaryExamplesResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryExampleItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryExampleItem[]", + "description": "Array of the dictionary examples elements." + } + }, + "description": "Response for the dictionary examples API.", + "required": [ + "result" + ] + }, + "DictionaryLookupItem": { + "type": "object", + "properties": { + "normalizedSource": { + "type": "string", + "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." + }, + "displaySource": { + "type": "string", + "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." + }, + "translations": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryTranslation" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryTranslation[]", + "description": "A list of translations for the source term." + } + }, + "description": "Dictionary Lookup Element", + "required": [ + "normalizedSource", + "displaySource", + "translations" + ] + }, + "DictionaryLookupParameters": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." + }, + "to": { + "type": "string", + "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." + } + }, + "description": "Request parameters for the dictionary lookup API.", + "required": [ + "from", + "to" + ] + }, + "DictionaryLookupResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/DictionaryLookupItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "DictionaryLookupItem[]", + "description": "Array of the dictionary lookup elements." + } + }, + "description": "Response for the dictionary lookup API.", + "required": [ + "result" + ] + }, + "DictionaryTranslation": { + "type": "object", + "properties": { + "normalizedTarget": { + "type": "string", + "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." + }, + "displayTarget": { + "type": "string", + "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." + }, + "posTag": { + "type": "string", + "description": "A string associating this term with a part-of-speech tag." + }, + "confidence": { + "type": "number", + "format": "float", + "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." + }, + "prefixWord": { + "type": "string", + "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." + }, + "backTranslations": { + "type": "array", + "items": { + "$ref": "#/definitions/BackTranslation" + }, + "x-ms-identifiers": [], + "x-typespec-name": "BackTranslation[]", + "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be." + } + }, + "description": "Translation source term.", + "required": [ + "normalizedTarget", + "displayTarget", + "posTag", + "confidence", + "prefixWord", + "backTranslations" + ] + }, + "ErrorDetails": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "Number identifier of the error." + }, + "message": { + "type": "string", + "description": "Human readable error description." + } + }, + "description": "Error details as returned by Translator Service.", + "required": [ + "code", + "message" + ] + }, + "ErrorResponse": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDetails", + "description": "Error details." + } + }, + "description": "Representation of the Error Response from Translator Service.", + "required": [ + "error" + ] + }, + "GetLanguagesResult": { + "type": "object", + "properties": { + "translation": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TranslationLanguage" + }, + "x-typespec-name": "Record", + "description": "Languages that support translate API." + }, + "transliteration": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TransliterationLanguage" + }, + "x-typespec-name": "Record", + "description": "Languages that support transliteration API." + }, + "dictionary": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/SourceDictionaryLanguage" + }, + "x-typespec-name": "Record", + "description": "Languages that support dictionary API." + } + }, + "description": "Response for the languages API." + }, + "InputTextItem": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "Text to translate." + } + }, + "description": "Element containing the text for translation.", + "required": [ + "text" + ] + }, + "ProfanityAction": { + "type": "string", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": true, + "values": [ + { + "name": "NoAction", + "value": "NoAction" + }, + { + "name": "Marked", + "value": "Marked" + }, + { + "name": "Deleted", + "value": "Deleted" + } + ] + } + }, + "ProfanityActionKnownValues": { + "type": "string", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityActionKnownValues", + "modelAsString": true, + "values": [ + { + "name": "NoAction", + "value": "NoAction" + }, + { + "name": "Marked", + "value": "Marked" + }, + { + "name": "Deleted", + "value": "Deleted" + } + ] + } + }, + "ProfanityMarker": { + "type": "string", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": true, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk" + }, + { + "name": "Tag", + "value": "Tag" + } + ] + } + }, + "ProfanityMarkerKnownValues": { + "type": "string", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarkerKnownValues", + "modelAsString": true, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk" + }, + { + "name": "Tag", + "value": "Tag" + } + ] + } + }, + "SentenceLength": { + "type": "object", + "properties": { + "srcSentLen": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "x-typespec-name": "int32[]", + "description": "An integer array representing the lengths of the sentences in the input text. \nThe length of the array is the number of sentences, and the values are the length of each sentence." + }, + "transSentLen": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "x-typespec-name": "int32[]", + "description": "An integer array representing the lengths of the sentences in the translated text. \nThe length of the array is the number of sentences, and the values are the length of each sentence." + } + }, + "description": "An object returning sentence boundaries in the input and output texts.", + "required": [ + "srcSentLen", + "transSentLen" + ] + }, + "SourceDictionaryLanguage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "type": "string", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + }, + "translations": { + "type": "array", + "items": { + "$ref": "#/definitions/TargetDictionaryLanguage" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TargetDictionaryLanguage[]", + "description": "List of languages with alterative translations and examples for the query expressed in the source language." + } + }, + "description": "Properties ot the source dictionary language", + "required": [ + "name", + "nativeName", + "dir", + "translations" + ] + }, + "SourceText": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "Input text in the default script of the source language." + } + }, + "description": "Input text in the default script of the source language. ", + "required": [ + "text" + ] + }, + "TargetDictionaryLanguage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "type": "string", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + }, + "code": { + "type": "string", + "description": "Language code identifying the target language." + } + }, + "description": "Properties of the target dictionary language", + "required": [ + "name", + "nativeName", + "dir", + "code" + ] + }, + "TextType": { + "type": "string", + "enum": [ + "plain", + "html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "plain" + }, + { + "name": "Html", + "value": "html" + } + ] + } + }, + "TextTypeKnownValues": { + "type": "string", + "enum": [ + "plain", + "html" + ], + "x-ms-enum": { + "name": "TextTypeKnownValues", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "plain" + }, + { + "name": "Html", + "value": "html" + } + ] + } + }, + "TranslatedTextAlignment": { + "type": "object", + "properties": { + "proj": { + "type": "string", + "description": "Maps input text to translated text. The alignment information is only provided when the request \nparameter includeAlignment is true. Alignment is returned as a string value of the following \nformat: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. \nThe colon separates start and end index, the dash separates the languages, and space separates the words. \nOne word may align with zero, one, or multiple words in the other language, and the aligned words may \nbe non-contiguous. When no alignment information is available, the alignment element will be empty." + } + }, + "description": "Alignment information object.", + "required": [ + "proj" + ] + }, + "TranslatedTextItem": { + "type": "object", + "properties": { + "detectedLanguage": { + "$ref": "#/definitions/DetectedLanguage", + "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." + }, + "translations": { + "type": "array", + "items": { + "$ref": "#/definitions/Translation" + }, + "x-ms-identifiers": [], + "x-typespec-name": "Translation[]", + "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter." + }, + "sourceText": { + "$ref": "#/definitions/SourceText", + "description": "Input text in the default script of the source language. sourceText property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text \nconverted into Arab script." + } + }, + "description": "Element containing the translated text", + "required": [ + "translations" + ] + }, + "Translation": { + "type": "object", + "properties": { + "to": { + "type": "string", + "description": "A string representing the language code of the target language." + }, + "text": { + "type": "string", + "description": "A string giving the translated text." + }, + "transliteration": { + "$ref": "#/definitions/TransliteratedText", + "description": "An object giving the translated text in the script specified by the toScript parameter." + }, + "alignment": { + "$ref": "#/definitions/TranslatedTextAlignment", + "description": "Alignment information." + }, + "sentLen": { + "$ref": "#/definitions/SentenceLength", + "description": "Sentence boundaries in the input and output texts." + } + }, + "description": "Translation result", + "required": [ + "to", + "text" + ] + }, + "TranslationLanguage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "dir": { + "type": "string", + "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." + } + }, + "description": "The value of the translation property is a dictionary of (key, value) pairs. Each key is a BCP 47 language tag.\nA key identifies a language for which text can be translated to or translated from.", + "required": [ + "name", + "nativeName", + "dir" + ] + }, + "TranslationResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/TranslatedTextItem" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TranslatedTextItem[]", + "description": "Array of the translated text elements." + } + }, + "description": "Response for the translation API.", + "required": [ + "result" + ] + }, + "TransliterableScript": { + "type": "object", + "properties": { + "toScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/CommonScriptModel" + }, + "x-ms-identifiers": [], + "x-typespec-name": "CommonScriptModel[]", + "description": "List of scripts available to convert text to." + } + }, + "description": "Script definition with list of script into which given script can be translitered.", + "required": [ + "toScripts" + ], + "allOf": [ + { + "$ref": "#/definitions/CommonScriptModel" + } + ] + }, + "TransliterateResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/TransliteratedText" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TransliteratedText[]", + "description": "Array of transliterated texts" + } + }, + "description": "Response for the transliteration API.", + "required": [ + "result" + ] + }, + "TransliteratedText": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "A string which is the result of converting the input string to the output script." + }, + "script": { + "type": "string", + "description": "A string specifying the script used in the output." + } + }, + "description": "Transliterated text element.", + "required": [ + "text", + "script" + ] + }, + "TransliterationLanguage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Display name of the language in the locale requested via Accept-Language header." + }, + "nativeName": { + "type": "string", + "description": "Display name of the language in the locale native for this language." + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/TransliterableScript" + }, + "x-ms-identifiers": [], + "x-typespec-name": "TransliterableScript[]", + "description": "List of scripts to convert from." + } + }, + "description": "The value of the transliteration property is a dictionary of (key, value) pairs. \nEach key is a BCP 47 language tag. A key identifies a language for which text can be converted from one script \nto another script.", + "required": [ + "name", + "nativeName", + "scripts" + ] + } + }, + "parameters": { + "BreakSentenceParameters.language": { + "name": "language", + "in": "query", + "required": false, + "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "BreakSentenceParameters.script": { + "name": "script", + "in": "query", + "required": false, + "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "GetLanguageParameters.acceptLanguage": { + "name": "Accept-Language", + "in": "header", + "required": false, + "description": "The language to use for user interface strings. Some of the fields in the response are names of languages or \nnames of regions. Use this parameter to define the language in which these names are returned. \nThe language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr` \nto request names in French or use the value `zh-Hant` to request names in Chinese Traditional.\nNames are provided in the English language when a target language is not specified or when localization \nis not available.", + "x-ms-client-name": "acceptLanguage", + "default": "en", + "type": "string", + "x-ms-parameter-location": "method" + }, + "GetLanguageParameters.ifNoneMatch": { + "name": "If-None-Match", + "in": "header", + "required": false, + "description": "Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response. \nIf the resource has not been modified, the service will return status code 304 and an empty response body.", + "x-ms-client-name": "ifNoneMatch", + "type": "string", + "x-ms-parameter-location": "method" + }, + "GetLanguageParameters.scope": { + "name": "scope", + "in": "query", + "required": false, + "description": "A comma-separated list of names defining the group of languages to return.\nAllowed group names are: `translation`, `transliteration` and `dictionary`.\nIf no scope is given, then all groups are returned, which is equivalent to passing \n`scope=translation,transliteration,dictionary`. To decide which set of supported languages \nis appropriate for your scenario, see the description of the [response object](#response-body).", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.allowFallback": { + "name": "allowFallback", + "in": "query", + "required": false, + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", + "default": true, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.category": { + "name": "category", + "in": "query", + "required": false, + "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", + "default": "general", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.from": { + "name": "from", + "in": "query", + "required": false, + "description": "Specifies the language of the input text. Find which languages are available to translate from by \nlooking up supported languages using the translation scope. If the from parameter isn't specified, \nautomatic language detection is applied to determine the source language.\n\nYou must use the from parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.fromScript": { + "name": "fromScript", + "in": "query", + "required": false, + "description": "Specifies the script of the input text.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.includeAlignment": { + "name": "includeAlignment", + "in": "query", + "required": false, + "description": "Specifies whether to include alignment projection from source text to translated text.\nPossible values are: true or false (default).", + "default": false, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.includeSentenceLength": { + "name": "includeSentenceLength", + "in": "query", + "required": false, + "description": "Specifies whether to include sentence boundaries for the input text and the translated text.\nPossible values are: true or false (default).", + "default": false, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.profanityAction": { + "name": "profanityAction", + "in": "query", + "required": false, + "default": "NoAction", + "type": "string", + "enum": [ + "NoAction", + "Marked", + "Deleted" + ], + "x-ms-enum": { + "name": "ProfanityAction", + "modelAsString": true, + "values": [ + { + "name": "NoAction", + "value": "NoAction" + }, + { + "name": "Marked", + "value": "Marked" + }, + { + "name": "Deleted", + "value": "Deleted" + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.profanityMarker": { + "name": "profanityMarker", + "in": "query", + "required": false, + "default": "Asterisk", + "type": "string", + "enum": [ + "Asterisk", + "Tag" + ], + "x-ms-enum": { + "name": "ProfanityMarker", + "modelAsString": true, + "values": [ + { + "name": "Asterisk", + "value": "Asterisk" + }, + { + "name": "Tag", + "value": "Tag" + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.suggestedFrom": { + "name": "suggestedFrom", + "in": "query", + "required": false, + "description": "Specifies a fallback language if the language of the input text can't be identified. \nLanguage autodetection is applied when the from parameter is omitted. If detection fails, \nthe suggestedFrom language will be assumed.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TranslateParameters.textType": { + "name": "textType", + "in": "query", + "required": false, + "default": "Plain", + "type": "string", + "enum": [ + "plain", + "html" + ], + "x-ms-enum": { + "name": "TextType", + "modelAsString": true, + "values": [ + { + "name": "Plain", + "value": "plain" + }, + { + "name": "Html", + "value": "html" + } + ] + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.to": { + "name": "to", + "in": "query", + "required": true, + "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", + "collectionFormat": "multi", + "type": "array", + "items": { + "type": "string" + }, + "x-ms-parameter-location": "method" + }, + "TranslateParameters.toScript": { + "name": "toScript", + "in": "query", + "required": false, + "description": "Specifies the script of the translated text.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.fromScript": { + "name": "fromScript", + "in": "query", + "required": true, + "description": "Specifies the script used by the input text. Look up supported languages using the transliteration scope,\nto find input scripts available for the selected language.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.language": { + "name": "language", + "in": "query", + "required": true, + "description": "Specifies the language of the text to convert from one script to another. \nPossible languages are listed in the transliteration scope obtained by querying the service \nfor its supported languages.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "TransliterateParameters.toScript": { + "name": "toScript", + "in": "query", + "required": true, + "description": "Specifies the output script. Look up supported languages using the transliteration scope, to find output \nscripts available for the selected combination of input language and input script.", + "type": "string", + "x-ms-parameter-location": "method" + } + } +} From 0ab2876628976b78ed1e08495f6d36fc148630e8 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 16:40:30 -0700 Subject: [PATCH 21/27] Update examples --- .../text/examples/3.0/Translate_MinimumSet_Gen.json | 2 +- specification/translation/text/models-translate.tsp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json b/specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json index b0f1e8783a55..f5f0658336b7 100644 --- a/specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json +++ b/specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json @@ -8,7 +8,7 @@ "api-version": "3.0", "requestBody": [ { - "Text": "This is a test." + "text": "This is a test." } ] }, diff --git a/specification/translation/text/models-translate.tsp b/specification/translation/text/models-translate.tsp index 603a48ee6302..c81e79bf8298 100644 --- a/specification/translation/text/models-translate.tsp +++ b/specification/translation/text/models-translate.tsp @@ -138,8 +138,8 @@ model TranslationResult { } enum TextTypeKnownValues { - Plain: "plain", - Html: "html", + Plain: "Plain", + Html: "Html", } @doc("Translation text type") From 10781613492673552e55317740b4d474e874af78 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 16:42:14 -0700 Subject: [PATCH 22/27] Prettier --- .../text/examples/3.0/GetLanguages_MinimumSet_Gen.json | 2 +- .../3.0/examples/GetLanguages_MinimumSet_Gen.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json b/specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json index 294302a79c49..76853b88e225 100644 --- a/specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json +++ b/specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json @@ -9,4 +9,4 @@ "body": {} } } -} \ No newline at end of file +} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json index 294302a79c49..76853b88e225 100644 --- a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json +++ b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json @@ -9,4 +9,4 @@ "body": {} } } -} \ No newline at end of file +} From 44380f0d7b028ad81c435d50f13b9777f955ae66 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 16:45:11 -0700 Subject: [PATCH 23/27] Generate new openapi.json --- .../examples/GetLanguages_MinimumSet_Gen.json | 2 +- .../examples/Translate_MinimumSet_Gen.json | 2 +- .../data-plane/text/stable/v3.0/openapi.json | 24 +- ...FindSentenceBoundaries_MinimumSet_Gen.json | 29 - .../examples/GetLanguages_MinimumSet_Gen.json | 12 - ...ookupDictionaryEntries_MinimumSet_Gen.json | 86 - ...okupDictionaryExamples_MinimumSet_Gen.json | 43 - .../examples/Translate_MinimumSet_Gen.json | 29 - .../Transliterate_MinimumSet_Gen.json | 25 - .../typespec-autorest/3.0/openapi.json | 1678 ----------------- 10 files changed, 14 insertions(+), 1916 deletions(-) delete mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json delete mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json delete mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json delete mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json delete mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Translate_MinimumSet_Gen.json delete mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Transliterate_MinimumSet_Gen.json delete mode 100644 specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/openapi.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json index 294302a79c49..76853b88e225 100644 --- a/specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json +++ b/specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json @@ -9,4 +9,4 @@ "body": {} } } -} \ No newline at end of file +} diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json index b0f1e8783a55..f5f0658336b7 100644 --- a/specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json +++ b/specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json @@ -8,7 +8,7 @@ "api-version": "3.0", "requestBody": [ { - "Text": "This is a test." + "text": "This is a test." } ] }, diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/text/stable/v3.0/openapi.json index 23e0cd0291ac..883148aa3f6c 100644 --- a/specification/translation/data-plane/text/stable/v3.0/openapi.json +++ b/specification/translation/data-plane/text/stable/v3.0/openapi.json @@ -1206,8 +1206,8 @@ "TextType": { "type": "string", "enum": [ - "plain", - "html" + "Plain", + "Html" ], "x-ms-enum": { "name": "TextType", @@ -1215,11 +1215,11 @@ "values": [ { "name": "Plain", - "value": "plain" + "value": "Plain" }, { "name": "Html", - "value": "html" + "value": "Html" } ] } @@ -1227,8 +1227,8 @@ "TextTypeKnownValues": { "type": "string", "enum": [ - "plain", - "html" + "Plain", + "Html" ], "x-ms-enum": { "name": "TextTypeKnownValues", @@ -1236,11 +1236,11 @@ "values": [ { "name": "Plain", - "value": "plain" + "value": "Plain" }, { "name": "Html", - "value": "html" + "value": "Html" } ] } @@ -1611,8 +1611,8 @@ "default": "Plain", "type": "string", "enum": [ - "plain", - "html" + "Plain", + "Html" ], "x-ms-enum": { "name": "TextType", @@ -1620,11 +1620,11 @@ "values": [ { "name": "Plain", - "value": "plain" + "value": "Plain" }, { "name": "Html", - "value": "html" + "value": "Html" } ] }, diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json deleted file mode 100644 index 06dde6ef2448..000000000000 --- a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "title": "Find Sentence Boundaries", - "operationId": "FindSentenceBoundaries", - "parameters": { - "api-version": "3.0", - "requestBody": [ - { - "text": "How are you? I am fine. What did you do today?" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "detectedLanguage": { - "language": "en", - "score": 1.0 - }, - "sentLen": [ - 13, - 11, - 22 - ] - } - ] - } - } -} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json deleted file mode 100644 index 76853b88e225..000000000000 --- a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/GetLanguages_MinimumSet_Gen.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "title": "Gets the set of languages currently supported by other operations of the Translator.", - "operationId": "GetLanguages", - "parameters": { - "api-version": "3.0" - }, - "responses": { - "200": { - "body": {} - } - } -} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json deleted file mode 100644 index 1c6b54e7e4eb..000000000000 --- a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "title": "Lookup Dictionary Entries", - "operationId": "LookupDictionaryEntries", - "parameters": { - "from": "en", - "to": "es", - "api-version": "3.0", - "requestBody": [ - { - "text": "fly" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "displaySource": "fly", - "translations": [ - { - "normalizedTarget": "volar", - "displayTarget": "volar", - "posTag": "VERB", - "confidence": 0.4081, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 4637 - }, - { - "normalizedText": "flying", - "displayText": "flying", - "numExamples": 15, - "frequencyCount": 1365 - }, - { - "normalizedText": "blow", - "displayText": "blow", - "numExamples": 15, - "frequencyCount": 503 - }, - { - "normalizedText": "flight", - "displayText": "flight", - "numExamples": 15, - "frequencyCount": 135 - } - ] - }, - { - "normalizedTarget": "mosca", - "displayTarget": "mosca", - "posTag": "NOUN", - "confidence": 0.2668, - "prefixWord": "", - "backTranslations": [ - { - "normalizedText": "fly", - "displayText": "fly", - "numExamples": 15, - "frequencyCount": 1697 - }, - { - "normalizedText": "flyweight", - "displayText": "flyweight", - "numExamples": 0, - "frequencyCount": 48 - }, - { - "normalizedText": "flies", - "displayText": "flies", - "numExamples": 9, - "frequencyCount": 34 - } - ] - } - ] - } - ] - } - } -} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json deleted file mode 100644 index 267599402c12..000000000000 --- a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "title": "Lookup Dictionary Examples", - "operationId": "LookupDictionaryExamples", - "parameters": { - "from": "en", - "to": "es", - "api-version": "3.0", - "requestBody": [ - { - "text": "fly", - "translation": "volar" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "normalizedSource": "fly", - "normalizedTarget": "volar", - "examples": [ - { - "sourcePrefix": "They need machines to ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Necesitan máquinas para ", - "targetTerm": "volar", - "targetSuffix": "." - }, - { - "sourcePrefix": "That should really ", - "sourceTerm": "fly", - "sourceSuffix": ".", - "targetPrefix": "Eso realmente debe ", - "targetTerm": "volar", - "targetSuffix": "." - } - ] - } - ] - } - } -} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Translate_MinimumSet_Gen.json deleted file mode 100644 index b0f1e8783a55..000000000000 --- a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Translate_MinimumSet_Gen.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "title": "Translate Text", - "operationId": "Translate", - "parameters": { - "to": [ - "fmlxpuepn" - ], - "api-version": "3.0", - "requestBody": [ - { - "Text": "This is a test." - } - ] - }, - "responses": { - "200": { - "body": [ - { - "translations": [ - { - "text": "Tohle je test.", - "to": "cs" - } - ] - } - ] - } - } -} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Transliterate_MinimumSet_Gen.json deleted file mode 100644 index ead6cff591f0..000000000000 --- a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/examples/Transliterate_MinimumSet_Gen.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "title": "Transliterate Text", - "operationId": "Transliterate", - "parameters": { - "language": "zh-Hans", - "fromScript": "Hans", - "toScript": "Latn", - "api-version": "3.0", - "requestBody": [ - { - "text": "这是个测试。" - } - ] - }, - "responses": { - "200": { - "body": [ - { - "text": "zhè shì gè cè shì。", - "script": "Latn" - } - ] - } - } -} diff --git a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/openapi.json b/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/openapi.json deleted file mode 100644 index 23e0cd0291ac..000000000000 --- a/specification/translation/text/tsp-output/@azure-tools/typespec-autorest/3.0/openapi.json +++ /dev/null @@ -1,1678 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Text Translation", - "version": "3.0", - "description": "Text translation is a cloud-based REST API feature of the Translator service that uses neural\nmachine translation technology to enable quick and accurate source-to-target text translation\nin real time across all supported languages.\n\nThe following methods are supported by the Text Translation feature:\n\nLanguages. Returns a list of languages supported by Translate, Transliterate, and Dictionary Lookup operations.\n\nTranslate. Renders single source-language text to multiple target-language texts with a single request.\n\nTransliterate. Converts characters or letters of a source language to the corresponding characters or letters of a target language.\n\nDetect. Returns the source code language code and a boolean variable denoting whether the detected language is supported for text translation and transliteration.\n\nDictionary lookup. Returns equivalent words for the source term in the target language.\n\nDictionary example Returns grammatical structure and context examples for the source term and target term pair.", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}", - "useSchemePrefix": false, - "parameters": [ - { - "name": "Endpoint", - "in": "path", - "required": true, - "description": "Supported Text Translation endpoints (protocol and hostname, for example:\n https://api.cognitive.microsofttranslator.com).", - "type": "string", - "format": "uri", - "x-ms-skip-url-encoding": true - } - ] - }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "tags": [], - "paths": { - "/breaksentence": { - "post": { - "operationId": "FindSentenceBoundaries", - "summary": "Find Sentence Boundaries", - "description": "Find Sentence Boundaries", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "required": false, - "description": "A client-generated GUID to uniquely identify the request.", - "x-ms-client-name": "clientTraceId", - "type": "string" - }, - { - "$ref": "#/parameters/BreakSentenceParameters.language" - }, - { - "$ref": "#/parameters/BreakSentenceParameters.script" - }, - { - "name": "api-version", - "in": "query", - "required": true, - "description": "Mandatory API version parameter", - "x-ms-client-name": "apiVersion", - "type": "string" - }, - { - "name": "requestBody", - "in": "body", - "required": true, - "description": "Defines the content of the request", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "InputTextItem[]" - } - } - ], - "responses": { - "200": { - "description": "Response for the Break SEntence API.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "BreakSentenceItem[]" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Find Sentence Boundaries": { - "$ref": "./examples/FindSentenceBoundaries_MinimumSet_Gen.json" - } - } - } - }, - "/dictionary/examples": { - "post": { - "operationId": "LookupDictionaryExamples", - "summary": "Lookup Dictionary Examples", - "description": "Lookup Dictionary Examples", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "required": false, - "description": "A client-generated GUID to uniquely identify the request.", - "x-ms-client-name": "clientTraceId", - "type": "string" - }, - { - "name": "from", - "in": "query", - "required": true, - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", - "type": "string" - }, - { - "name": "to", - "in": "query", - "required": true, - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", - "type": "string" - }, - { - "name": "api-version", - "in": "query", - "required": true, - "description": "Mandatory API version parameter", - "x-ms-client-name": "apiVersion", - "type": "string" - }, - { - "name": "requestBody", - "in": "body", - "required": true, - "description": "Defines the content of the request", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExampleTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "DictionaryExampleTextItem[]" - } - } - ], - "responses": { - "200": { - "description": "Response for the dictionary examples API.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "DictionaryExampleItem[]" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Lookup Dictionary Examples": { - "$ref": "./examples/LookupDictionaryExamples_MinimumSet_Gen.json" - } - } - } - }, - "/dictionary/lookup": { - "post": { - "operationId": "LookupDictionaryEntries", - "summary": "Lookup Dictionary Entries", - "description": "Lookup Dictionary Entries", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "required": false, - "description": "A client-generated GUID to uniquely identify the request.", - "x-ms-client-name": "clientTraceId", - "type": "string" - }, - { - "name": "from", - "in": "query", - "required": true, - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", - "type": "string" - }, - { - "name": "to", - "in": "query", - "required": true, - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", - "type": "string" - }, - { - "name": "api-version", - "in": "query", - "required": true, - "description": "Mandatory API version parameter", - "x-ms-client-name": "apiVersion", - "type": "string" - }, - { - "name": "requestBody", - "in": "body", - "required": true, - "description": "Defines the content of the request", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "InputTextItem[]" - } - } - ], - "responses": { - "200": { - "description": "Response for the dictionary lookup API.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "DictionaryLookupItem[]" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Lookup Dictionary Entries": { - "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" - } - } - } - }, - "/languages": { - "get": { - "operationId": "GetLanguages", - "summary": "Gets the set of languages currently supported by other operations of the Translator.", - "description": "Gets the set of languages currently supported by other operations of the Translator.", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "required": false, - "description": "A client-generated GUID to uniquely identify the request.", - "x-ms-client-name": "clientTraceId", - "type": "string" - }, - { - "$ref": "#/parameters/GetLanguageParameters.scope" - }, - { - "$ref": "#/parameters/GetLanguageParameters.acceptLanguage" - }, - { - "$ref": "#/parameters/GetLanguageParameters.ifNoneMatch" - }, - { - "name": "api-version", - "in": "query", - "required": true, - "description": "Mandatory API version parameter", - "x-ms-client-name": "apiVersion", - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - }, - "ETag": { - "description": "Current value of the entity tag for the requested groups of supported languages. \nTo make subsequent requests more efficient, the client may send the `ETag` value in an \n`If-None-Match` header field.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/GetLanguagesResult" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Gets the set of languages currently supported by other operations of the Translator.": { - "$ref": "./examples/GetLanguages_MinimumSet_Gen.json" - } - } - } - }, - "/translate": { - "post": { - "operationId": "Translate", - "summary": "Translate Text", - "description": "Translate Text", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "required": false, - "description": "A client-generated GUID to uniquely identify the request.", - "x-ms-client-name": "clientTraceId", - "type": "string" - }, - { - "$ref": "#/parameters/TranslateParameters.to" - }, - { - "$ref": "#/parameters/TranslateParameters.from" - }, - { - "$ref": "#/parameters/TranslateParameters.textType" - }, - { - "$ref": "#/parameters/TranslateParameters.category" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityAction" - }, - { - "$ref": "#/parameters/TranslateParameters.profanityMarker" - }, - { - "$ref": "#/parameters/TranslateParameters.includeAlignment" - }, - { - "$ref": "#/parameters/TranslateParameters.includeSentenceLength" - }, - { - "$ref": "#/parameters/TranslateParameters.suggestedFrom" - }, - { - "$ref": "#/parameters/TranslateParameters.fromScript" - }, - { - "$ref": "#/parameters/TranslateParameters.toScript" - }, - { - "$ref": "#/parameters/TranslateParameters.allowFallback" - }, - { - "name": "api-version", - "in": "query", - "required": true, - "description": "Mandatory API version parameter", - "x-ms-client-name": "apiVersion", - "type": "string" - }, - { - "name": "requestBody", - "in": "body", - "required": true, - "description": "Defines the content of the request", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "InputTextItem[]" - } - } - ], - "responses": { - "200": { - "description": "Response for the translation API.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - }, - "x-mt-system": { - "description": "Specifies the system type that was used for translation for each 'to' language requested for translation. \nThe value is a comma-separated list of strings. Each string indicates a type:\n\n* Custom - Request includes a custom system and at least one custom system was used during translation.\n* Team - All other requests", - "type": "string" - }, - "x-metered-usage": { - "description": "Specifies consumption (the number of characters for which the user will be charged) for the translation \njob request. For example, if the word \"Hello\" is translated from English (en) to French (fr), \nthis field will return the value '5'.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "TranslatedTextItem[]" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Translate Text": { - "$ref": "./examples/Translate_MinimumSet_Gen.json" - } - } - } - }, - "/transliterate": { - "post": { - "operationId": "Transliterate", - "summary": "Transliterate Text", - "description": "Transliterate Text", - "parameters": [ - { - "name": "X-ClientTraceId", - "in": "header", - "required": false, - "description": "A client-generated GUID to uniquely identify the request.", - "x-ms-client-name": "clientTraceId", - "type": "string" - }, - { - "$ref": "#/parameters/TransliterateParameters.language" - }, - { - "$ref": "#/parameters/TransliterateParameters.fromScript" - }, - { - "$ref": "#/parameters/TransliterateParameters.toScript" - }, - { - "name": "api-version", - "in": "query", - "required": true, - "description": "Mandatory API version parameter", - "x-ms-client-name": "apiVersion", - "type": "string" - }, - { - "name": "requestBody", - "in": "body", - "required": true, - "description": "Defines the content of the request", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InputTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "InputTextItem[]" - } - } - ], - "responses": { - "200": { - "description": "Response for the transliteration API.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [], - "x-typespec-name": "TransliteratedText[]" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "X-RequestId": { - "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Transliterate Text": { - "$ref": "./examples/Transliterate_MinimumSet_Gen.json" - } - } - } - } - }, - "definitions": { - "APIVersion": { - "type": "string", - "description": "Text Translation supported versions", - "enum": [ - "3.0" - ], - "x-ms-enum": { - "name": "APIVersion", - "modelAsString": true, - "values": [ - { - "name": "v3_0", - "value": "3.0" - } - ] - } - }, - "BackTranslation": { - "type": "object", - "properties": { - "normalizedText": { - "type": "string", - "description": "A string giving the normalized form of the source term that is a back-translation of the target.\nThis value should be used as input to lookup examples." - }, - "displayText": { - "type": "string", - "description": "A string giving the source term that is a back-translation of the target in a form best\nsuited for end-user display." - }, - "numExamples": { - "type": "integer", - "format": "int32", - "description": "An integer representing the number of examples that are available for this translation pair.\nActual examples must be retrieved with a separate call to lookup examples. The number is mostly\nintended to facilitate display in a UX. For example, a user interface may add a hyperlink\nto the back-translation if the number of examples is greater than zero and show the back-translation\nas plain text if there are no examples. Note that the actual number of examples returned\nby a call to lookup examples may be less than numExamples, because additional filtering may be\napplied on the fly to remove \"bad\" examples." - }, - "frequencyCount": { - "type": "integer", - "format": "int32", - "description": "An integer representing the frequency of this translation pair in the data. The main purpose of this\nfield is to provide a user interface with a means to sort back-translations so the most frequent terms are first." - } - }, - "description": "Back Translation", - "required": [ - "normalizedText", - "displayText", - "numExamples", - "frequencyCount" - ] - }, - "BreakSentenceItem": { - "type": "object", - "properties": { - "detectedLanguage": { - "$ref": "#/definitions/DetectedLanguage", - "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." - }, - "sentLen": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "x-typespec-name": "int32[]", - "description": "An integer array representing the lengths of the sentences in the input text.\nThe length of the array is the number of sentences, and the values are the length of each sentence." - } - }, - "description": "Item containing break sentence result.", - "required": [ - "sentLen" - ] - }, - "BreakSentenceResult": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "$ref": "#/definitions/BreakSentenceItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "BreakSentenceItem[]", - "description": "Array of the break sentence elements." - } - }, - "description": "Response for the Break SEntence API.", - "required": [ - "result" - ] - }, - "CommonScriptModel": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Code identifying the script." - }, - "name": { - "type": "string", - "description": "Display name of the script in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for the language." - }, - "dir": { - "type": "string", - "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." - } - }, - "description": "Common properties of language script", - "required": [ - "code", - "name", - "nativeName", - "dir" - ] - }, - "DetectedLanguage": { - "type": "object", - "properties": { - "language": { - "type": "string", - "description": "A string representing the code of the detected language." - }, - "score": { - "type": "number", - "format": "float", - "description": "A float value indicating the confidence in the result.\nThe score is between zero and one and a low score indicates a low confidence." - } - }, - "description": "An object describing the detected language.", - "required": [ - "language", - "score" - ] - }, - "DictionaryExample": { - "type": "object", - "properties": { - "sourcePrefix": { - "type": "string", - "description": "The string to concatenate before the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." - }, - "sourceTerm": { - "type": "string", - "description": "A string equal to the actual term looked up. The string is added with sourcePrefix\nand sourceSuffix to form the complete example. Its value is separated so it can be\nmarked in a user interface, e.g., by bolding it." - }, - "sourceSuffix": { - "type": "string", - "description": "The string to concatenate after the value of sourceTerm to form a complete example.\nDo not add a space character, since it is already there when it should be.\nThis value may be an empty string." - }, - "targetPrefix": { - "type": "string", - "description": "A string similar to sourcePrefix but for the target." - }, - "targetTerm": { - "type": "string", - "description": "A string similar to sourceTerm but for the target." - }, - "targetSuffix": { - "type": "string", - "description": "A string similar to sourceSuffix but for the target." - } - }, - "description": "Dictionary Example", - "required": [ - "sourcePrefix", - "sourceTerm", - "sourceSuffix", - "targetPrefix", - "targetTerm", - "targetSuffix" - ] - }, - "DictionaryExampleItem": { - "type": "object", - "properties": { - "normalizedSource": { - "type": "string", - "description": "A string giving the normalized form of the source term. Generally, this should be identical\nto the value of the Text field at the matching list index in the body of the request." - }, - "normalizedTarget": { - "type": "string", - "description": "A string giving the normalized form of the target term. Generally, this should be identical\nto the value of the Translation field at the matching list index in the body of the request." - }, - "examples": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExample" - }, - "x-ms-identifiers": [], - "x-typespec-name": "DictionaryExample[]", - "description": "A list of examples for the (source term, target term) pair." - } - }, - "description": "Dictionary Example element", - "required": [ - "normalizedSource", - "normalizedTarget", - "examples" - ] - }, - "DictionaryExampleTextItem": { - "type": "object", - "properties": { - "translation": { - "type": "string", - "description": "A string specifying the translated text previously returned by the Dictionary lookup operation. \nThis should be the value from the normalizedTarget field in the translations list of the Dictionary \nlookup response. The service will return examples for the specific source-target word-pair." - } - }, - "description": "Element containing the text with translation.", - "required": [ - "translation" - ], - "allOf": [ - { - "$ref": "#/definitions/InputTextItem" - } - ] - }, - "DictionaryExamplesParameters": { - "type": "object", - "properties": { - "from": { - "type": "string", - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." - }, - "to": { - "type": "string", - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." - } - }, - "description": "Request parameters for the dictionary examples API.", - "required": [ - "from", - "to" - ] - }, - "DictionaryExamplesResult": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryExampleItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "DictionaryExampleItem[]", - "description": "Array of the dictionary examples elements." - } - }, - "description": "Response for the dictionary examples API.", - "required": [ - "result" - ] - }, - "DictionaryLookupItem": { - "type": "object", - "properties": { - "normalizedSource": { - "type": "string", - "description": "A string giving the normalized form of the source term.\nFor example, if the request is \"JOHN\", the normalized form will be \"john\".\nThe content of this field becomes the input to lookup examples." - }, - "displaySource": { - "type": "string", - "description": "A string giving the source term in a form best suited for end-user display.\nFor example, if the input is \"JOHN\", the display form will reflect the usual\nspelling of the name: \"John\"." - }, - "translations": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryTranslation" - }, - "x-ms-identifiers": [], - "x-typespec-name": "DictionaryTranslation[]", - "description": "A list of translations for the source term." - } - }, - "description": "Dictionary Lookup Element", - "required": [ - "normalizedSource", - "displaySource", - "translations" - ] - }, - "DictionaryLookupParameters": { - "type": "object", - "properties": { - "from": { - "type": "string", - "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope." - }, - "to": { - "type": "string", - "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope." - } - }, - "description": "Request parameters for the dictionary lookup API.", - "required": [ - "from", - "to" - ] - }, - "DictionaryLookupResult": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "$ref": "#/definitions/DictionaryLookupItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "DictionaryLookupItem[]", - "description": "Array of the dictionary lookup elements." - } - }, - "description": "Response for the dictionary lookup API.", - "required": [ - "result" - ] - }, - "DictionaryTranslation": { - "type": "object", - "properties": { - "normalizedTarget": { - "type": "string", - "description": "A string giving the normalized form of this term in the target language.\nThis value should be used as input to lookup examples." - }, - "displayTarget": { - "type": "string", - "description": "A string giving the term in the target language and in a form best suited\nfor end-user display. Generally, this will only differ from the normalizedTarget\nin terms of capitalization. For example, a proper noun like \"Juan\" will have\nnormalizedTarget = \"juan\" and displayTarget = \"Juan\"." - }, - "posTag": { - "type": "string", - "description": "A string associating this term with a part-of-speech tag." - }, - "confidence": { - "type": "number", - "format": "float", - "description": "A value between 0.0 and 1.0 which represents the \"confidence\" \n(or perhaps more accurately, \"probability in the training data\") of that translation pair. \nThe sum of confidence scores for one source word may or may not sum to 1.0." - }, - "prefixWord": { - "type": "string", - "description": "A string giving the word to display as a prefix of the translation. Currently,\nthis is the gendered determiner of nouns, in languages that have gendered determiners.\nFor example, the prefix of the Spanish word \"mosca\" is \"la\", since \"mosca\" is a feminine noun in Spanish. \nThis is only dependent on the translation, and not on the source. \nIf there is no prefix, it will be the empty string." - }, - "backTranslations": { - "type": "array", - "items": { - "$ref": "#/definitions/BackTranslation" - }, - "x-ms-identifiers": [], - "x-typespec-name": "BackTranslation[]", - "description": "A list of \"back translations\" of the target. For example, source words that the target can translate to.\nThe list is guaranteed to contain the source word that was requested (e.g., if the source word being\nlooked up is \"fly\", then it is guaranteed that \"fly\" will be in the backTranslations list).\nHowever, it is not guaranteed to be in the first position, and often will not be." - } - }, - "description": "Translation source term.", - "required": [ - "normalizedTarget", - "displayTarget", - "posTag", - "confidence", - "prefixWord", - "backTranslations" - ] - }, - "ErrorDetails": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "Number identifier of the error." - }, - "message": { - "type": "string", - "description": "Human readable error description." - } - }, - "description": "Error details as returned by Translator Service.", - "required": [ - "code", - "message" - ] - }, - "ErrorResponse": { - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/ErrorDetails", - "description": "Error details." - } - }, - "description": "Representation of the Error Response from Translator Service.", - "required": [ - "error" - ] - }, - "GetLanguagesResult": { - "type": "object", - "properties": { - "translation": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/TranslationLanguage" - }, - "x-typespec-name": "Record", - "description": "Languages that support translate API." - }, - "transliteration": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/TransliterationLanguage" - }, - "x-typespec-name": "Record", - "description": "Languages that support transliteration API." - }, - "dictionary": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/SourceDictionaryLanguage" - }, - "x-typespec-name": "Record", - "description": "Languages that support dictionary API." - } - }, - "description": "Response for the languages API." - }, - "InputTextItem": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "Text to translate." - } - }, - "description": "Element containing the text for translation.", - "required": [ - "text" - ] - }, - "ProfanityAction": { - "type": "string", - "enum": [ - "NoAction", - "Marked", - "Deleted" - ], - "x-ms-enum": { - "name": "ProfanityAction", - "modelAsString": true, - "values": [ - { - "name": "NoAction", - "value": "NoAction" - }, - { - "name": "Marked", - "value": "Marked" - }, - { - "name": "Deleted", - "value": "Deleted" - } - ] - } - }, - "ProfanityActionKnownValues": { - "type": "string", - "enum": [ - "NoAction", - "Marked", - "Deleted" - ], - "x-ms-enum": { - "name": "ProfanityActionKnownValues", - "modelAsString": true, - "values": [ - { - "name": "NoAction", - "value": "NoAction" - }, - { - "name": "Marked", - "value": "Marked" - }, - { - "name": "Deleted", - "value": "Deleted" - } - ] - } - }, - "ProfanityMarker": { - "type": "string", - "enum": [ - "Asterisk", - "Tag" - ], - "x-ms-enum": { - "name": "ProfanityMarker", - "modelAsString": true, - "values": [ - { - "name": "Asterisk", - "value": "Asterisk" - }, - { - "name": "Tag", - "value": "Tag" - } - ] - } - }, - "ProfanityMarkerKnownValues": { - "type": "string", - "enum": [ - "Asterisk", - "Tag" - ], - "x-ms-enum": { - "name": "ProfanityMarkerKnownValues", - "modelAsString": true, - "values": [ - { - "name": "Asterisk", - "value": "Asterisk" - }, - { - "name": "Tag", - "value": "Tag" - } - ] - } - }, - "SentenceLength": { - "type": "object", - "properties": { - "srcSentLen": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "x-typespec-name": "int32[]", - "description": "An integer array representing the lengths of the sentences in the input text. \nThe length of the array is the number of sentences, and the values are the length of each sentence." - }, - "transSentLen": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "x-typespec-name": "int32[]", - "description": "An integer array representing the lengths of the sentences in the translated text. \nThe length of the array is the number of sentences, and the values are the length of each sentence." - } - }, - "description": "An object returning sentence boundaries in the input and output texts.", - "required": [ - "srcSentLen", - "transSentLen" - ] - }, - "SourceDictionaryLanguage": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Display name of the language in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for this language." - }, - "dir": { - "type": "string", - "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." - }, - "translations": { - "type": "array", - "items": { - "$ref": "#/definitions/TargetDictionaryLanguage" - }, - "x-ms-identifiers": [], - "x-typespec-name": "TargetDictionaryLanguage[]", - "description": "List of languages with alterative translations and examples for the query expressed in the source language." - } - }, - "description": "Properties ot the source dictionary language", - "required": [ - "name", - "nativeName", - "dir", - "translations" - ] - }, - "SourceText": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "Input text in the default script of the source language." - } - }, - "description": "Input text in the default script of the source language. ", - "required": [ - "text" - ] - }, - "TargetDictionaryLanguage": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Display name of the language in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for this language." - }, - "dir": { - "type": "string", - "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." - }, - "code": { - "type": "string", - "description": "Language code identifying the target language." - } - }, - "description": "Properties of the target dictionary language", - "required": [ - "name", - "nativeName", - "dir", - "code" - ] - }, - "TextType": { - "type": "string", - "enum": [ - "plain", - "html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "plain" - }, - { - "name": "Html", - "value": "html" - } - ] - } - }, - "TextTypeKnownValues": { - "type": "string", - "enum": [ - "plain", - "html" - ], - "x-ms-enum": { - "name": "TextTypeKnownValues", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "plain" - }, - { - "name": "Html", - "value": "html" - } - ] - } - }, - "TranslatedTextAlignment": { - "type": "object", - "properties": { - "proj": { - "type": "string", - "description": "Maps input text to translated text. The alignment information is only provided when the request \nparameter includeAlignment is true. Alignment is returned as a string value of the following \nformat: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. \nThe colon separates start and end index, the dash separates the languages, and space separates the words. \nOne word may align with zero, one, or multiple words in the other language, and the aligned words may \nbe non-contiguous. When no alignment information is available, the alignment element will be empty." - } - }, - "description": "Alignment information object.", - "required": [ - "proj" - ] - }, - "TranslatedTextItem": { - "type": "object", - "properties": { - "detectedLanguage": { - "$ref": "#/definitions/DetectedLanguage", - "description": "The detectedLanguage property is only present in the result object when language auto-detection is requested." - }, - "translations": { - "type": "array", - "items": { - "$ref": "#/definitions/Translation" - }, - "x-ms-identifiers": [], - "x-typespec-name": "Translation[]", - "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter." - }, - "sourceText": { - "$ref": "#/definitions/SourceText", - "description": "Input text in the default script of the source language. sourceText property is present only when \nthe input is expressed in a script that's not the usual script for the language. For example, \nif the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text \nconverted into Arab script." - } - }, - "description": "Element containing the translated text", - "required": [ - "translations" - ] - }, - "Translation": { - "type": "object", - "properties": { - "to": { - "type": "string", - "description": "A string representing the language code of the target language." - }, - "text": { - "type": "string", - "description": "A string giving the translated text." - }, - "transliteration": { - "$ref": "#/definitions/TransliteratedText", - "description": "An object giving the translated text in the script specified by the toScript parameter." - }, - "alignment": { - "$ref": "#/definitions/TranslatedTextAlignment", - "description": "Alignment information." - }, - "sentLen": { - "$ref": "#/definitions/SentenceLength", - "description": "Sentence boundaries in the input and output texts." - } - }, - "description": "Translation result", - "required": [ - "to", - "text" - ] - }, - "TranslationLanguage": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Display name of the language in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for this language." - }, - "dir": { - "type": "string", - "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." - } - }, - "description": "The value of the translation property is a dictionary of (key, value) pairs. Each key is a BCP 47 language tag.\nA key identifies a language for which text can be translated to or translated from.", - "required": [ - "name", - "nativeName", - "dir" - ] - }, - "TranslationResult": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "$ref": "#/definitions/TranslatedTextItem" - }, - "x-ms-identifiers": [], - "x-typespec-name": "TranslatedTextItem[]", - "description": "Array of the translated text elements." - } - }, - "description": "Response for the translation API.", - "required": [ - "result" - ] - }, - "TransliterableScript": { - "type": "object", - "properties": { - "toScripts": { - "type": "array", - "items": { - "$ref": "#/definitions/CommonScriptModel" - }, - "x-ms-identifiers": [], - "x-typespec-name": "CommonScriptModel[]", - "description": "List of scripts available to convert text to." - } - }, - "description": "Script definition with list of script into which given script can be translitered.", - "required": [ - "toScripts" - ], - "allOf": [ - { - "$ref": "#/definitions/CommonScriptModel" - } - ] - }, - "TransliterateResult": { - "type": "object", - "properties": { - "result": { - "type": "array", - "items": { - "$ref": "#/definitions/TransliteratedText" - }, - "x-ms-identifiers": [], - "x-typespec-name": "TransliteratedText[]", - "description": "Array of transliterated texts" - } - }, - "description": "Response for the transliteration API.", - "required": [ - "result" - ] - }, - "TransliteratedText": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "A string which is the result of converting the input string to the output script." - }, - "script": { - "type": "string", - "description": "A string specifying the script used in the output." - } - }, - "description": "Transliterated text element.", - "required": [ - "text", - "script" - ] - }, - "TransliterationLanguage": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Display name of the language in the locale requested via Accept-Language header." - }, - "nativeName": { - "type": "string", - "description": "Display name of the language in the locale native for this language." - }, - "scripts": { - "type": "array", - "items": { - "$ref": "#/definitions/TransliterableScript" - }, - "x-ms-identifiers": [], - "x-typespec-name": "TransliterableScript[]", - "description": "List of scripts to convert from." - } - }, - "description": "The value of the transliteration property is a dictionary of (key, value) pairs. \nEach key is a BCP 47 language tag. A key identifies a language for which text can be converted from one script \nto another script.", - "required": [ - "name", - "nativeName", - "scripts" - ] - } - }, - "parameters": { - "BreakSentenceParameters.language": { - "name": "language", - "in": "query", - "required": false, - "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied.", - "type": "string", - "x-ms-parameter-location": "method" - }, - "BreakSentenceParameters.script": { - "name": "script", - "in": "query", - "required": false, - "description": "Script tag identifying the script used by the input text. \nIf a script isn't specified, the default script of the language will be assumed.", - "type": "string", - "x-ms-parameter-location": "method" - }, - "GetLanguageParameters.acceptLanguage": { - "name": "Accept-Language", - "in": "header", - "required": false, - "description": "The language to use for user interface strings. Some of the fields in the response are names of languages or \nnames of regions. Use this parameter to define the language in which these names are returned. \nThe language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr` \nto request names in French or use the value `zh-Hant` to request names in Chinese Traditional.\nNames are provided in the English language when a target language is not specified or when localization \nis not available.", - "x-ms-client-name": "acceptLanguage", - "default": "en", - "type": "string", - "x-ms-parameter-location": "method" - }, - "GetLanguageParameters.ifNoneMatch": { - "name": "If-None-Match", - "in": "header", - "required": false, - "description": "Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response. \nIf the resource has not been modified, the service will return status code 304 and an empty response body.", - "x-ms-client-name": "ifNoneMatch", - "type": "string", - "x-ms-parameter-location": "method" - }, - "GetLanguageParameters.scope": { - "name": "scope", - "in": "query", - "required": false, - "description": "A comma-separated list of names defining the group of languages to return.\nAllowed group names are: `translation`, `transliteration` and `dictionary`.\nIf no scope is given, then all groups are returned, which is equivalent to passing \n`scope=translation,transliteration,dictionary`. To decide which set of supported languages \nis appropriate for your scenario, see the description of the [response object](#response-body).", - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.allowFallback": { - "name": "allowFallback", - "in": "query", - "required": false, - "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.\n\nallowFallback=false specifies that the translation should only use systems trained for the category specified \nby the request. If a translation for language X to language Y requires chaining through a pivot language E, \nthen all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. \nIf no system is found with the specific category, the request will return a 400 status code. allowFallback=true \nspecifies that the service is allowed to fall back to a general system when a custom system doesn't exist.", - "default": true, - "type": "boolean", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.category": { - "name": "category", - "in": "query", - "required": false, - "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", - "default": "general", - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.from": { - "name": "from", - "in": "query", - "required": false, - "description": "Specifies the language of the input text. Find which languages are available to translate from by \nlooking up supported languages using the translation scope. If the from parameter isn't specified, \nautomatic language detection is applied to determine the source language.\n\nYou must use the from parameter rather than autodetection when using the dynamic dictionary feature. \nNote: the dynamic dictionary feature is case-sensitive.", - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.fromScript": { - "name": "fromScript", - "in": "query", - "required": false, - "description": "Specifies the script of the input text.", - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.includeAlignment": { - "name": "includeAlignment", - "in": "query", - "required": false, - "description": "Specifies whether to include alignment projection from source text to translated text.\nPossible values are: true or false (default).", - "default": false, - "type": "boolean", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.includeSentenceLength": { - "name": "includeSentenceLength", - "in": "query", - "required": false, - "description": "Specifies whether to include sentence boundaries for the input text and the translated text.\nPossible values are: true or false (default).", - "default": false, - "type": "boolean", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.profanityAction": { - "name": "profanityAction", - "in": "query", - "required": false, - "default": "NoAction", - "type": "string", - "enum": [ - "NoAction", - "Marked", - "Deleted" - ], - "x-ms-enum": { - "name": "ProfanityAction", - "modelAsString": true, - "values": [ - { - "name": "NoAction", - "value": "NoAction" - }, - { - "name": "Marked", - "value": "Marked" - }, - { - "name": "Deleted", - "value": "Deleted" - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.profanityMarker": { - "name": "profanityMarker", - "in": "query", - "required": false, - "default": "Asterisk", - "type": "string", - "enum": [ - "Asterisk", - "Tag" - ], - "x-ms-enum": { - "name": "ProfanityMarker", - "modelAsString": true, - "values": [ - { - "name": "Asterisk", - "value": "Asterisk" - }, - { - "name": "Tag", - "value": "Tag" - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.suggestedFrom": { - "name": "suggestedFrom", - "in": "query", - "required": false, - "description": "Specifies a fallback language if the language of the input text can't be identified. \nLanguage autodetection is applied when the from parameter is omitted. If detection fails, \nthe suggestedFrom language will be assumed.", - "type": "string", - "x-ms-parameter-location": "method" - }, - "TranslateParameters.textType": { - "name": "textType", - "in": "query", - "required": false, - "default": "Plain", - "type": "string", - "enum": [ - "plain", - "html" - ], - "x-ms-enum": { - "name": "TextType", - "modelAsString": true, - "values": [ - { - "name": "Plain", - "value": "plain" - }, - { - "name": "Html", - "value": "html" - } - ] - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.to": { - "name": "to", - "in": "query", - "required": true, - "description": "Specifies the language of the output text. The target language must be one of the supported languages included \nin the translation scope. For example, use to=de to translate to German.\nIt's possible to translate to multiple languages simultaneously by repeating the parameter in the query string. \nFor example, use to=de&to=it to translate to German and Italian.", - "collectionFormat": "multi", - "type": "array", - "items": { - "type": "string" - }, - "x-ms-parameter-location": "method" - }, - "TranslateParameters.toScript": { - "name": "toScript", - "in": "query", - "required": false, - "description": "Specifies the script of the translated text.", - "type": "string", - "x-ms-parameter-location": "method" - }, - "TransliterateParameters.fromScript": { - "name": "fromScript", - "in": "query", - "required": true, - "description": "Specifies the script used by the input text. Look up supported languages using the transliteration scope,\nto find input scripts available for the selected language.", - "type": "string", - "x-ms-parameter-location": "method" - }, - "TransliterateParameters.language": { - "name": "language", - "in": "query", - "required": true, - "description": "Specifies the language of the text to convert from one script to another. \nPossible languages are listed in the transliteration scope obtained by querying the service \nfor its supported languages.", - "type": "string", - "x-ms-parameter-location": "method" - }, - "TransliterateParameters.toScript": { - "name": "toScript", - "in": "query", - "required": true, - "description": "Specifies the output script. Look up supported languages using the transliteration scope, to find output \nscripts available for the selected combination of input language and input script.", - "type": "string", - "x-ms-parameter-location": "method" - } - } -} From d8167097d27598649298659b154b36d75f150549 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 17:03:04 -0700 Subject: [PATCH 24/27] adding azure-resource-provider-folder config --- specification/translation/text/tspconfig.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/translation/text/tspconfig.yaml b/specification/translation/text/tspconfig.yaml index 649f1d0743d4..6fe3f79abd89 100644 --- a/specification/translation/text/tspconfig.yaml +++ b/specification/translation/text/tspconfig.yaml @@ -1,6 +1,7 @@ options: "@azure-tools/typespec-autorest": "output-file": "openapi.json" + azure-resource-provider-folder: ../data-plane/text "examples-directory": ./examples "@azure-tools/typespec-csharp": clear-output-folder: true From f1d3f6f31eab1bb6072bc06baa2b5a02412abd6b Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Fri, 31 Mar 2023 17:20:40 -0700 Subject: [PATCH 25/27] Suppress warning --- specification/translation/text/routes.tsp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/translation/text/routes.tsp b/specification/translation/text/routes.tsp index aee55b5cd0b1..e1f1655c8fce 100644 --- a/specification/translation/text/routes.tsp +++ b/specification/translation/text/routes.tsp @@ -34,6 +34,7 @@ op CustomGetOperation( apiVersion: string ): TResponse | TError; +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @get @route("languages") @summary("Gets the set of languages currently supported by other operations of the Translator.") @@ -45,6 +46,7 @@ op GetLanguages is CustomGetOperation< ErrorResponse >; +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post @route("translate") @summary("Translate Text") @@ -57,6 +59,7 @@ op Translate is CustomOperation< ErrorResponse >; +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post @route("transliterate") @summary("Transliterate Text") @@ -69,6 +72,7 @@ op Transliterate is CustomOperation< ErrorResponse >; +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post @route("breaksentence") @summary("Find Sentence Boundaries") @@ -81,6 +85,7 @@ op FindSentenceBoundaries is CustomOperation< ErrorResponse >; +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post @route("dictionary/lookup") @summary("Lookup Dictionary Entries") @@ -93,6 +98,7 @@ op LookupDictionaryEntries is CustomOperation< ErrorResponse >; +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @post @route("dictionary/examples") @summary("Lookup Dictionary Examples") From ce8c217d678841fc73af3083223512ec262882b3 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Mon, 3 Apr 2023 08:23:42 -0700 Subject: [PATCH 26/27] Remove sdk-for-net-track2 --- specification/translation/data-plane/text/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/translation/data-plane/text/readme.md b/specification/translation/data-plane/text/readme.md index d8e67a1158ac..b55f41720d99 100644 --- a/specification/translation/data-plane/text/readme.md +++ b/specification/translation/data-plane/text/readme.md @@ -28,7 +28,6 @@ This is not used by Autorest itself. ``` yaml $(swagger-to-sdk) swagger-to-sdk: - - repo: azure-sdk-for-net-track2 ``` ## Multi-API/Profile support for AutoRest v3 generators From 535c659b00a6bf6700d27cea938c9b996c0a0681 Mon Sep 17 00:00:00 2001 From: Michal Materna Date: Mon, 3 Apr 2023 13:40:00 -0700 Subject: [PATCH 27/27] Changing the name of the folder as per PR comment --- .../examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json | 0 .../examples/3.0}/FindSentenceBoundaries_MinimumSet_Gen.json | 0 .../examples/3.0/GetLanguages_MaximumSet_Gen.json | 0 .../examples/3.0}/GetLanguages_MinimumSet_Gen.json | 0 .../examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json | 0 .../examples/3.0}/LookupDictionaryEntries_MinimumSet_Gen.json | 0 .../examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json | 0 .../examples/3.0}/LookupDictionaryExamples_MinimumSet_Gen.json | 0 .../examples/3.0/Translate_MaximumSet_Gen.json | 0 .../examples/3.0}/Translate_MinimumSet_Gen.json | 0 .../examples/3.0/Transliterate_MaximumSet_Gen.json | 0 .../examples/3.0}/Transliterate_MinimumSet_Gen.json | 0 .../translation/{text => Azure.AI.TextTranslation}/main.tsp | 0 .../{text => Azure.AI.TextTranslation}/models-breaksentence.tsp | 0 .../{text => Azure.AI.TextTranslation}/models-dictionary.tsp | 0 .../{text => Azure.AI.TextTranslation}/models-languages.tsp | 0 .../{text => Azure.AI.TextTranslation}/models-shared.tsp | 0 .../{text => Azure.AI.TextTranslation}/models-translate.tsp | 0 .../{text => Azure.AI.TextTranslation}/models-transliterate.tsp | 0 .../translation/{text => Azure.AI.TextTranslation}/package.json | 0 .../translation/{text => Azure.AI.TextTranslation}/routes.tsp | 0 .../{text => Azure.AI.TextTranslation}/tspconfig.yaml | 2 +- .../data-plane/{text => Azure.AI.TextTranslation}/readme.md | 0 .../v3.0/examples}/FindSentenceBoundaries_MinimumSet_Gen.json | 0 .../stable/v3.0/examples}/GetLanguages_MinimumSet_Gen.json | 0 .../v3.0/examples}/LookupDictionaryEntries_MinimumSet_Gen.json | 0 .../v3.0/examples}/LookupDictionaryExamples_MinimumSet_Gen.json | 0 .../stable/v3.0/examples}/Translate_MinimumSet_Gen.json | 0 .../stable/v3.0/examples}/Transliterate_MinimumSet_Gen.json | 0 .../{text => Azure.AI.TextTranslation}/stable/v3.0/openapi.json | 0 30 files changed, 1 insertion(+), 1 deletion(-) rename specification/translation/{text => Azure.AI.TextTranslation}/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json (100%) rename specification/translation/{data-plane/text/stable/v3.0/examples => Azure.AI.TextTranslation/examples/3.0}/FindSentenceBoundaries_MinimumSet_Gen.json (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/examples/3.0/GetLanguages_MaximumSet_Gen.json (100%) rename specification/translation/{data-plane/text/stable/v3.0/examples => Azure.AI.TextTranslation/examples/3.0}/GetLanguages_MinimumSet_Gen.json (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json (100%) rename specification/translation/{data-plane/text/stable/v3.0/examples => Azure.AI.TextTranslation/examples/3.0}/LookupDictionaryEntries_MinimumSet_Gen.json (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json (100%) rename specification/translation/{data-plane/text/stable/v3.0/examples => Azure.AI.TextTranslation/examples/3.0}/LookupDictionaryExamples_MinimumSet_Gen.json (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/examples/3.0/Translate_MaximumSet_Gen.json (100%) rename specification/translation/{data-plane/text/stable/v3.0/examples => Azure.AI.TextTranslation/examples/3.0}/Translate_MinimumSet_Gen.json (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/examples/3.0/Transliterate_MaximumSet_Gen.json (100%) rename specification/translation/{data-plane/text/stable/v3.0/examples => Azure.AI.TextTranslation/examples/3.0}/Transliterate_MinimumSet_Gen.json (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/main.tsp (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/models-breaksentence.tsp (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/models-dictionary.tsp (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/models-languages.tsp (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/models-shared.tsp (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/models-translate.tsp (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/models-transliterate.tsp (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/package.json (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/routes.tsp (100%) rename specification/translation/{text => Azure.AI.TextTranslation}/tspconfig.yaml (90%) rename specification/translation/data-plane/{text => Azure.AI.TextTranslation}/readme.md (100%) rename specification/translation/{text/examples/3.0 => data-plane/Azure.AI.TextTranslation/stable/v3.0/examples}/FindSentenceBoundaries_MinimumSet_Gen.json (100%) rename specification/translation/{text/examples/3.0 => data-plane/Azure.AI.TextTranslation/stable/v3.0/examples}/GetLanguages_MinimumSet_Gen.json (100%) rename specification/translation/{text/examples/3.0 => data-plane/Azure.AI.TextTranslation/stable/v3.0/examples}/LookupDictionaryEntries_MinimumSet_Gen.json (100%) rename specification/translation/{text/examples/3.0 => data-plane/Azure.AI.TextTranslation/stable/v3.0/examples}/LookupDictionaryExamples_MinimumSet_Gen.json (100%) rename specification/translation/{text/examples/3.0 => data-plane/Azure.AI.TextTranslation/stable/v3.0/examples}/Translate_MinimumSet_Gen.json (100%) rename specification/translation/{text/examples/3.0 => data-plane/Azure.AI.TextTranslation/stable/v3.0/examples}/Transliterate_MinimumSet_Gen.json (100%) rename specification/translation/data-plane/{text => Azure.AI.TextTranslation}/stable/v3.0/openapi.json (100%) diff --git a/specification/translation/text/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/text/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/GetLanguages_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetLanguages_MaximumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/GetLanguages_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/GetLanguages_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/GetLanguages_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/text/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/GetLanguages_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/text/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/Translate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/Translate_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/text/stable/v3.0/examples/Translate_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/Translate_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/Transliterate_MaximumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/Transliterate_MaximumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MaximumSet_Gen.json diff --git a/specification/translation/data-plane/text/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json b/specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/data-plane/text/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json rename to specification/translation/Azure.AI.TextTranslation/examples/3.0/Transliterate_MinimumSet_Gen.json diff --git a/specification/translation/text/main.tsp b/specification/translation/Azure.AI.TextTranslation/main.tsp similarity index 100% rename from specification/translation/text/main.tsp rename to specification/translation/Azure.AI.TextTranslation/main.tsp diff --git a/specification/translation/text/models-breaksentence.tsp b/specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp similarity index 100% rename from specification/translation/text/models-breaksentence.tsp rename to specification/translation/Azure.AI.TextTranslation/models-breaksentence.tsp diff --git a/specification/translation/text/models-dictionary.tsp b/specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp similarity index 100% rename from specification/translation/text/models-dictionary.tsp rename to specification/translation/Azure.AI.TextTranslation/models-dictionary.tsp diff --git a/specification/translation/text/models-languages.tsp b/specification/translation/Azure.AI.TextTranslation/models-languages.tsp similarity index 100% rename from specification/translation/text/models-languages.tsp rename to specification/translation/Azure.AI.TextTranslation/models-languages.tsp diff --git a/specification/translation/text/models-shared.tsp b/specification/translation/Azure.AI.TextTranslation/models-shared.tsp similarity index 100% rename from specification/translation/text/models-shared.tsp rename to specification/translation/Azure.AI.TextTranslation/models-shared.tsp diff --git a/specification/translation/text/models-translate.tsp b/specification/translation/Azure.AI.TextTranslation/models-translate.tsp similarity index 100% rename from specification/translation/text/models-translate.tsp rename to specification/translation/Azure.AI.TextTranslation/models-translate.tsp diff --git a/specification/translation/text/models-transliterate.tsp b/specification/translation/Azure.AI.TextTranslation/models-transliterate.tsp similarity index 100% rename from specification/translation/text/models-transliterate.tsp rename to specification/translation/Azure.AI.TextTranslation/models-transliterate.tsp diff --git a/specification/translation/text/package.json b/specification/translation/Azure.AI.TextTranslation/package.json similarity index 100% rename from specification/translation/text/package.json rename to specification/translation/Azure.AI.TextTranslation/package.json diff --git a/specification/translation/text/routes.tsp b/specification/translation/Azure.AI.TextTranslation/routes.tsp similarity index 100% rename from specification/translation/text/routes.tsp rename to specification/translation/Azure.AI.TextTranslation/routes.tsp diff --git a/specification/translation/text/tspconfig.yaml b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml similarity index 90% rename from specification/translation/text/tspconfig.yaml rename to specification/translation/Azure.AI.TextTranslation/tspconfig.yaml index 6fe3f79abd89..8f95639b2df9 100644 --- a/specification/translation/text/tspconfig.yaml +++ b/specification/translation/Azure.AI.TextTranslation/tspconfig.yaml @@ -1,7 +1,7 @@ options: "@azure-tools/typespec-autorest": "output-file": "openapi.json" - azure-resource-provider-folder: ../data-plane/text + azure-resource-provider-folder: ../data-plane/Azure.AI.TextTranslation "examples-directory": ./examples "@azure-tools/typespec-csharp": clear-output-folder: true diff --git a/specification/translation/data-plane/text/readme.md b/specification/translation/data-plane/Azure.AI.TextTranslation/readme.md similarity index 100% rename from specification/translation/data-plane/text/readme.md rename to specification/translation/data-plane/Azure.AI.TextTranslation/readme.md diff --git a/specification/translation/text/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/FindSentenceBoundaries_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/FindSentenceBoundaries_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/GetLanguages_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/GetLanguages_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/LookupDictionaryEntries_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryEntries_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/LookupDictionaryExamples_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/LookupDictionaryExamples_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/Translate_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Translate_MinimumSet_Gen.json diff --git a/specification/translation/text/examples/3.0/Transliterate_MinimumSet_Gen.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json similarity index 100% rename from specification/translation/text/examples/3.0/Transliterate_MinimumSet_Gen.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/examples/Transliterate_MinimumSet_Gen.json diff --git a/specification/translation/data-plane/text/stable/v3.0/openapi.json b/specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json similarity index 100% rename from specification/translation/data-plane/text/stable/v3.0/openapi.json rename to specification/translation/data-plane/Azure.AI.TextTranslation/stable/v3.0/openapi.json