{ "swagger": "2.0", "info": { "title": "Text Translation", "version": "3.0", "description": "Azure Translator is a cloud-based, multilingual, neural machine translation service. The Text Translation API enables robust and scalable translation capabilities suitable for diverse applications.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "{Endpoint}", "useSchemePrefix": false, "parameters": [ { "name": "Endpoint", "in": "path", "description": "Supported Text Translation endpoints (protocol and hostname, for example:\n https://api.cognitive.microsofttranslator.com).", "required": true, "type": "string", "format": "uri", "x-ms-skip-url-encoding": true } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "ApiKeyAuth": [] }, { "OAuth2Auth": [ "https://cognitiveservices.azure.com/.default" ] } ], "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Ocp-Apim-Subscription-Key", "in": "header" }, "OAuth2Auth": { "type": "oauth2", "flow": "accessCode", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "https://cognitiveservices.azure.com/.default": "" }, "tokenUrl": "https://login.microsoftonline.com/common/oauth2/token" } }, "tags": [], "paths": { "/breaksentence": { "post": { "operationId": "FindSentenceBoundaries", "summary": "Find Sentence Boundaries", "description": "Find Sentence Boundaries", "parameters": [ { "name": "X-ClientTraceId", "in": "header", "description": "A client-generated GUID to uniquely identify the request.", "required": false, "type": "string", "x-ms-client-name": "clientTraceId" }, { "$ref": "#/parameters/BreakSentenceParameters.language" }, { "$ref": "#/parameters/BreakSentenceParameters.script" }, { "name": "api-version", "in": "query", "description": "Mandatory API version parameter", "required": true, "type": "string", "x-ms-client-name": "apiVersion" }, { "name": "body", "in": "body", "description": "Defines the content of the request", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/InputTextItem" } } } ], "responses": { "200": { "description": "Response for the Break SEntence API.", "schema": { "type": "array", "items": { "$ref": "#/definitions/BreakSentenceItem" } }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } } }, "x-ms-examples": { "Find Sentence Boundaries": { "$ref": "./examples/FindSentenceBoundaries_MaximumSet_Gen.json" }, "Find Sentence Boundaries with minimum properties": { "$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", "description": "A client-generated GUID to uniquely identify the request.", "required": false, "type": "string", "x-ms-client-name": "clientTraceId" }, { "$ref": "#/parameters/DictionaryExamplesParameters.from" }, { "$ref": "#/parameters/DictionaryExamplesParameters.to" }, { "name": "api-version", "in": "query", "description": "Mandatory API version parameter", "required": true, "type": "string", "x-ms-client-name": "apiVersion" }, { "name": "body", "in": "body", "description": "Defines the content of the request", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleTextItem" } } } ], "responses": { "200": { "description": "Response for the dictionary examples API.", "schema": { "type": "array", "items": { "$ref": "#/definitions/DictionaryExampleItem" } }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } } }, "x-ms-examples": { "Lookup Dictionary Examples": { "$ref": "./examples/LookupDictionaryExamples_MaximumSet_Gen.json" }, "Lookup Dictionary Examples with minimum properties": { "$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", "description": "A client-generated GUID to uniquely identify the request.", "required": false, "type": "string", "x-ms-client-name": "clientTraceId" }, { "$ref": "#/parameters/DictionaryLookupParameters.from" }, { "$ref": "#/parameters/DictionaryLookupParameters.to" }, { "name": "api-version", "in": "query", "description": "Mandatory API version parameter", "required": true, "type": "string", "x-ms-client-name": "apiVersion" }, { "name": "body", "in": "body", "description": "Defines the content of the request", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/InputTextItem" } } } ], "responses": { "200": { "description": "Response for the dictionary lookup API.", "schema": { "type": "array", "items": { "$ref": "#/definitions/DictionaryLookupItem" } }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } } }, "x-ms-examples": { "Lookup Dictionary Entries": { "$ref": "./examples/LookupDictionaryEntries_MaximumSet_Gen.json" }, "Lookup Dictionary Entries with minimum properties": { "$ref": "./examples/LookupDictionaryEntries_MinimumSet_Gen.json" } } } }, "/languages": { "get": { "operationId": "GetSupportedLanguages", "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", "description": "A client-generated GUID to uniquely identify the request.", "required": false, "type": "string", "x-ms-client-name": "clientTraceId" }, { "$ref": "#/parameters/GetSupportedLanguagesParameters.scope" }, { "$ref": "#/parameters/GetSupportedLanguagesParameters.acceptLanguage" }, { "$ref": "#/parameters/GetSupportedLanguagesParameters.ifNoneMatch" }, { "name": "api-version", "in": "query", "description": "Mandatory API version parameter", "required": true, "type": "string", "x-ms-client-name": "apiVersion" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/GetSupportedLanguagesResult" }, "headers": { "ETag": { "type": "string", "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." }, "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } } }, "x-ms-examples": { "Gets the set of languages currently supported by other operations of the Translator with minimum properties.": { "$ref": "./examples/GetSupportedLanguages_MinimumSet_Gen.json" }, "Gets the set of languages currently supported by other operations of the Translator.": { "$ref": "./examples/GetSupportedLanguages_MaximumSet_Gen.json" } } } }, "/translate": { "post": { "operationId": "Translate", "summary": "Translate Text", "description": "Translate Text", "parameters": [ { "name": "X-ClientTraceId", "in": "header", "description": "A client-generated GUID to uniquely identify the request.", "required": false, "type": "string", "x-ms-client-name": "clientTraceId" }, { "$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", "description": "Mandatory API version parameter", "required": true, "type": "string", "x-ms-client-name": "apiVersion" }, { "name": "body", "in": "body", "description": "Defines the content of the request", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/InputTextItem" } } } ], "responses": { "200": { "description": "Response for the translation API.", "schema": { "type": "array", "items": { "$ref": "#/definitions/TranslatedTextItem" } }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." }, "x-metered-usage": { "type": "integer", "format": "int32", "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'." }, "x-mt-system": { "type": "string", "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" } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } } }, "x-ms-examples": { "Translate Text": { "$ref": "./examples/Translate_MaximumSet_Gen.json" }, "Translate Text with minimum properties": { "$ref": "./examples/Translate_MinimumSet_Gen.json" } } } }, "/transliterate": { "post": { "operationId": "Transliterate", "summary": "Transliterate Text", "description": "Transliterate Text", "parameters": [ { "name": "X-ClientTraceId", "in": "header", "description": "A client-generated GUID to uniquely identify the request.", "required": false, "type": "string", "x-ms-client-name": "clientTraceId" }, { "$ref": "#/parameters/TransliterateParameters.language" }, { "$ref": "#/parameters/TransliterateParameters.fromScript" }, { "$ref": "#/parameters/TransliterateParameters.toScript" }, { "name": "api-version", "in": "query", "description": "Mandatory API version parameter", "required": true, "type": "string", "x-ms-client-name": "apiVersion" }, { "name": "body", "in": "body", "description": "Defines the content of the request", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/InputTextItem" } } } ], "responses": { "200": { "description": "Response for the transliteration API.", "schema": { "type": "array", "items": { "$ref": "#/definitions/TransliteratedText" } }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" }, "headers": { "X-RequestId": { "type": "string", "description": "Value generated by the service to identify the request. It is used for troubleshooting purposes." } } } }, "x-ms-examples": { "Transliterate Text": { "$ref": "./examples/Transliterate_MaximumSet_Gen.json" }, "Transliterate Text with minimum properties": { "$ref": "./examples/Transliterate_MinimumSet_Gen.json" } } } } }, "definitions": { "BackTranslation": { "type": "object", "description": "Back Translation", "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." } }, "required": [ "normalizedText", "displayText", "numExamples", "frequencyCount" ] }, "BreakSentenceItem": { "type": "object", "description": "Item containing break sentence result.", "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", "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.", "items": { "type": "integer", "format": "int32" } } }, "required": [ "sentLen" ] }, "BreakSentenceResult": { "type": "object", "description": "Response for the Break SEntence API.", "properties": { "result": { "type": "array", "description": "Array of the break sentence elements.", "items": { "$ref": "#/definitions/BreakSentenceItem" } } }, "required": [ "result" ] }, "DetectedLanguage": { "type": "object", "description": "An object describing the detected language.", "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." } }, "required": [ "language", "score" ] }, "DictionaryExample": { "type": "object", "description": "Dictionary Example", "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." } }, "required": [ "sourcePrefix", "sourceTerm", "sourceSuffix", "targetPrefix", "targetTerm", "targetSuffix" ] }, "DictionaryExampleItem": { "type": "object", "description": "Dictionary Example element", "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", "description": "A list of examples for the (source term, target term) pair.", "items": { "$ref": "#/definitions/DictionaryExample" } } }, "required": [ "normalizedSource", "normalizedTarget", "examples" ] }, "DictionaryExampleTextItem": { "type": "object", "description": "Element containing the text with translation.", "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." } }, "required": [ "translation" ], "allOf": [ { "$ref": "#/definitions/InputTextItem" } ] }, "DictionaryExamplesResult": { "type": "object", "description": "Response for the dictionary examples API.", "properties": { "result": { "type": "array", "description": "Array of the dictionary examples elements.", "items": { "$ref": "#/definitions/DictionaryExampleItem" } } }, "required": [ "result" ] }, "DictionaryLookupItem": { "type": "object", "description": "Dictionary Lookup Element", "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", "description": "A list of translations for the source term.", "items": { "$ref": "#/definitions/DictionaryTranslation" } } }, "required": [ "normalizedSource", "displaySource", "translations" ] }, "DictionaryLookupResult": { "type": "object", "description": "Response for the dictionary lookup API.", "properties": { "result": { "type": "array", "description": "Array of the dictionary lookup elements.", "items": { "$ref": "#/definitions/DictionaryLookupItem" } } }, "required": [ "result" ] }, "DictionaryTranslation": { "type": "object", "description": "Translation source term.", "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", "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.", "items": { "$ref": "#/definitions/BackTranslation" } } }, "required": [ "normalizedTarget", "displayTarget", "posTag", "confidence", "prefixWord", "backTranslations" ] }, "ErrorDetails": { "type": "object", "description": "Error details as returned by Translator Service.", "properties": { "code": { "type": "integer", "format": "int32", "description": "Number identifier of the error." }, "message": { "type": "string", "description": "Human readable error description." } }, "required": [ "code", "message" ] }, "ErrorResponse": { "type": "object", "description": "Representation of the Error Response from Translator Service.", "properties": { "error": { "$ref": "#/definitions/ErrorDetails", "description": "Error details." } }, "required": [ "error" ] }, "GetSupportedLanguagesResult": { "type": "object", "description": "Response for the languages API.", "properties": { "translation": { "type": "object", "description": "Languages that support translate API.", "additionalProperties": { "$ref": "#/definitions/TranslationLanguage" } }, "transliteration": { "type": "object", "description": "Languages that support transliteration API.", "additionalProperties": { "$ref": "#/definitions/TransliterationLanguage" } }, "dictionary": { "type": "object", "description": "Languages that support dictionary API.", "additionalProperties": { "$ref": "#/definitions/SourceDictionaryLanguage" } } } }, "InputTextItem": { "type": "object", "description": "Element containing the text for translation.", "properties": { "text": { "type": "string", "description": "Text to translate." } }, "required": [ "text" ] }, "LanguageDirectionality": { "type": "string", "description": "Language Directionality", "enum": [ "ltr", "rtl" ], "x-ms-enum": { "name": "LanguageDirectionality", "modelAsString": false, "values": [ { "name": "LeftToRight", "value": "ltr", "description": "Language is written left to right." }, { "name": "RightToLeft", "value": "rtl", "description": "Language is written right to left." } ] } }, "LanguageScript": { "type": "object", "description": "Common properties of language script", "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": { "$ref": "#/definitions/LanguageDirectionality", "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." } }, "required": [ "code", "name", "nativeName", "dir" ] }, "ProfanityAction": { "type": "string", "description": "Translator profanity actions", "enum": [ "NoAction", "Marked", "Deleted" ], "x-ms-enum": { "name": "ProfanityAction", "modelAsString": false, "values": [ { "name": "NoAction", "value": "NoAction", "description": "No Action is taken on profanity" }, { "name": "Marked", "value": "Marked", "description": "Profanity is marked." }, { "name": "Deleted", "value": "Deleted", "description": "Profanity is deleted from the translated text." } ] } }, "ProfanityMarker": { "type": "string", "description": "Translator profanity markers", "enum": [ "Asterisk", "Tag" ], "x-ms-enum": { "name": "ProfanityMarker", "modelAsString": false, "values": [ { "name": "Asterisk", "value": "Asterisk", "description": "Profanity is marked with asterisk." }, { "name": "Tag", "value": "Tag", "description": "Profanity is marked with the tags." } ] } }, "SentenceBoundaries": { "type": "object", "description": "An object returning sentence boundaries in the input and output texts.", "properties": { "srcSentLen": { "type": "array", "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.", "items": { "type": "integer", "format": "int32" } }, "transSentLen": { "type": "array", "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.", "items": { "type": "integer", "format": "int32" } } }, "required": [ "srcSentLen", "transSentLen" ] }, "SourceDictionaryLanguage": { "type": "object", "description": "Properties ot the source dictionary language", "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": { "$ref": "#/definitions/LanguageDirectionality", "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." }, "translations": { "type": "array", "description": "List of languages with alterative translations and examples for the query expressed in the source language.", "items": { "$ref": "#/definitions/TargetDictionaryLanguage" } } }, "required": [ "name", "nativeName", "dir", "translations" ] }, "SourceText": { "type": "object", "description": "Input text in the default script of the source language. ", "properties": { "text": { "type": "string", "description": "Input text in the default script of the source language." } }, "required": [ "text" ] }, "TargetDictionaryLanguage": { "type": "object", "description": "Properties of the target dictionary language", "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": { "$ref": "#/definitions/LanguageDirectionality", "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." } }, "required": [ "name", "nativeName", "dir", "code" ] }, "TextType": { "type": "string", "description": "Translation text type", "enum": [ "Plain", "Html" ], "x-ms-enum": { "name": "TextType", "modelAsString": true, "values": [ { "name": "Plain", "value": "Plain", "description": "Plain text." }, { "name": "Html", "value": "Html", "description": "HTML-encoded text." } ] } }, "TranslatedTextAlignment": { "type": "object", "description": "Alignment information 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." } }, "required": [ "proj" ] }, "TranslatedTextItem": { "type": "object", "description": "Element containing the translated text", "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", "description": "An array of translation results. The size of the array matches the number of target \nlanguages specified through the to query parameter.", "items": { "$ref": "#/definitions/TranslationText" } }, "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." } }, "required": [ "translations" ] }, "TranslationLanguage": { "type": "object", "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.", "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": { "$ref": "#/definitions/LanguageDirectionality", "description": "Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages." } }, "required": [ "name", "nativeName", "dir" ] }, "TranslationResult": { "type": "object", "description": "Response for the translation API.", "properties": { "result": { "type": "array", "description": "Array of the translated text elements.", "items": { "$ref": "#/definitions/TranslatedTextItem" } } }, "required": [ "result" ] }, "TranslationText": { "type": "object", "description": "Translation result", "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/SentenceBoundaries", "description": "Sentence boundaries in the input and output texts." } }, "required": [ "to", "text" ] }, "TransliterableScript": { "type": "object", "description": "Script definition with list of script into which given script can be translitered.", "properties": { "toScripts": { "type": "array", "description": "List of scripts available to convert text to.", "items": { "$ref": "#/definitions/LanguageScript" } } }, "required": [ "toScripts" ], "allOf": [ { "$ref": "#/definitions/LanguageScript" } ] }, "TransliterateResult": { "type": "object", "description": "Response for the transliteration API.", "properties": { "result": { "type": "array", "description": "Array of transliterated texts", "items": { "$ref": "#/definitions/TransliteratedText" } } }, "required": [ "result" ] }, "TransliteratedText": { "type": "object", "description": "Transliterated text element.", "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." } }, "required": [ "text", "script" ] }, "TransliterationLanguage": { "type": "object", "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.", "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", "description": "List of scripts to convert from.", "items": { "$ref": "#/definitions/TransliterableScript" } } }, "required": [ "name", "nativeName", "scripts" ] } }, "parameters": { "BreakSentenceParameters.language": { "name": "language", "in": "query", "description": "Language tag identifying the language of the input text. \nIf a code isn't specified, automatic language detection will be applied.", "required": false, "type": "string", "x-ms-parameter-location": "method" }, "BreakSentenceParameters.script": { "name": "script", "in": "query", "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.", "required": false, "type": "string", "x-ms-parameter-location": "method" }, "DictionaryExamplesParameters.from": { "name": "from", "in": "query", "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "DictionaryExamplesParameters.to": { "name": "to", "in": "query", "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "DictionaryLookupParameters.from": { "name": "from", "in": "query", "description": "Specifies the language of the input text.\nThe source language must be one of the supported languages included in the dictionary scope.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "DictionaryLookupParameters.to": { "name": "to", "in": "query", "description": "Specifies the language of the output text.\nThe target language must be one of the supported languages included in the dictionary scope.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "GetSupportedLanguagesParameters.acceptLanguage": { "name": "Accept-Language", "in": "header", "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.", "required": false, "type": "string", "default": "en", "x-ms-parameter-location": "method", "x-ms-client-name": "acceptLanguage" }, "GetSupportedLanguagesParameters.ifNoneMatch": { "name": "If-None-Match", "in": "header", "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.", "required": false, "type": "string", "x-ms-parameter-location": "method", "x-ms-client-name": "ifNoneMatch" }, "GetSupportedLanguagesParameters.scope": { "name": "scope", "in": "query", "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).", "required": false, "type": "string", "x-ms-parameter-location": "method" }, "TranslateParameters.allowFallback": { "name": "allowFallback", "in": "query", "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.", "required": false, "type": "boolean", "default": true, "x-ms-parameter-location": "method" }, "TranslateParameters.category": { "name": "category", "in": "query", "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.", "required": false, "type": "string", "default": "general", "x-ms-parameter-location": "method" }, "TranslateParameters.from": { "name": "from", "in": "query", "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.", "required": false, "type": "string", "x-ms-parameter-location": "method" }, "TranslateParameters.fromScript": { "name": "fromScript", "in": "query", "description": "Specifies the script of the input text.", "required": false, "type": "string", "x-ms-parameter-location": "method" }, "TranslateParameters.includeAlignment": { "name": "includeAlignment", "in": "query", "description": "Specifies whether to include alignment projection from source text to translated text.\nPossible values are: true or false (default).", "required": false, "type": "boolean", "default": false, "x-ms-parameter-location": "method" }, "TranslateParameters.includeSentenceLength": { "name": "includeSentenceLength", "in": "query", "description": "Specifies whether to include sentence boundaries for the input text and the translated text.\nPossible values are: true or false (default).", "required": false, "type": "boolean", "default": false, "x-ms-parameter-location": "method" }, "TranslateParameters.profanityAction": { "name": "profanityAction", "in": "query", "description": "Specifies how profanities should be treated in translations.\nPossible values are: NoAction (default), Marked or Deleted.", "required": false, "type": "string", "default": "NoAction", "enum": [ "NoAction", "Marked", "Deleted" ], "x-ms-enum": { "name": "ProfanityAction", "modelAsString": false, "values": [ { "name": "NoAction", "value": "NoAction", "description": "No Action is taken on profanity" }, { "name": "Marked", "value": "Marked", "description": "Profanity is marked." }, { "name": "Deleted", "value": "Deleted", "description": "Profanity is deleted from the translated text." } ] }, "x-ms-parameter-location": "method" }, "TranslateParameters.profanityMarker": { "name": "profanityMarker", "in": "query", "description": "Specifies how profanities should be marked in translations.\nPossible values are: Asterisk (default) or Tag. ", "required": false, "type": "string", "default": "Asterisk", "enum": [ "Asterisk", "Tag" ], "x-ms-enum": { "name": "ProfanityMarker", "modelAsString": false, "values": [ { "name": "Asterisk", "value": "Asterisk", "description": "Profanity is marked with asterisk." }, { "name": "Tag", "value": "Tag", "description": "Profanity is marked with the tags." } ] }, "x-ms-parameter-location": "method" }, "TranslateParameters.suggestedFrom": { "name": "suggestedFrom", "in": "query", "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.", "required": false, "type": "string", "x-ms-parameter-location": "method" }, "TranslateParameters.textType": { "name": "textType", "in": "query", "description": "Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, \ncomplete element. Possible values are: plain (default) or html.", "required": false, "type": "string", "default": "Plain", "enum": [ "Plain", "Html" ], "x-ms-enum": { "name": "TextType", "modelAsString": true, "values": [ { "name": "Plain", "value": "Plain", "description": "Plain text." }, { "name": "Html", "value": "Html", "description": "HTML-encoded text." } ] }, "x-ms-parameter-location": "method" }, "TranslateParameters.to": { "name": "to", "in": "query", "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.", "required": true, "type": "array", "items": { "type": "string" }, "collectionFormat": "multi", "x-ms-parameter-location": "method" }, "TranslateParameters.toScript": { "name": "toScript", "in": "query", "description": "Specifies the script of the translated text.", "required": false, "type": "string", "x-ms-parameter-location": "method" }, "TransliterateParameters.fromScript": { "name": "fromScript", "in": "query", "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.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "TransliterateParameters.language": { "name": "language", "in": "query", "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.", "required": true, "type": "string", "x-ms-parameter-location": "method" }, "TransliterateParameters.toScript": { "name": "toScript", "in": "query", "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.", "required": true, "type": "string", "x-ms-parameter-location": "method" } } }