import { ServiceClientOptions } from "@azure/ms-rest-js";
import * as msRest from "@azure/ms-rest-js";
/**
* An interface representing LanguagesResultTranslationLanguageCode.
*/
export interface LanguagesResultTranslationLanguageCode {
name?: string;
nativeName?: string;
dir?: string;
}
/**
* An interface representing LanguagesResultTranslation.
*/
export interface LanguagesResultTranslation {
languageCode?: LanguagesResultTranslationLanguageCode;
}
/**
* An interface representing LanguagesResultTransliterationLanguageCodeScriptsItemToScriptsItem.
*/
export interface LanguagesResultTransliterationLanguageCodeScriptsItemToScriptsItem {
code?: string;
name?: string;
nativeName?: string;
dir?: string;
}
/**
* An interface representing LanguagesResultTransliterationLanguageCodeScriptsItem.
*/
export interface LanguagesResultTransliterationLanguageCodeScriptsItem {
code?: string;
name?: string;
nativeName?: string;
dir?: string;
toScripts?: LanguagesResultTransliterationLanguageCodeScriptsItemToScriptsItem[];
}
/**
* An interface representing LanguagesResultTransliterationLanguageCode.
*/
export interface LanguagesResultTransliterationLanguageCode {
name?: string;
nativeName?: string;
scripts?: LanguagesResultTransliterationLanguageCodeScriptsItem[];
}
/**
* An interface representing LanguagesResultTransliteration.
*/
export interface LanguagesResultTransliteration {
languageCode?: LanguagesResultTransliterationLanguageCode;
}
/**
* An interface representing LanguagesResultDictionaryLanguageCodeTranslationsItem.
*/
export interface LanguagesResultDictionaryLanguageCodeTranslationsItem {
name?: string;
nativeName?: string;
dir?: string;
code?: string;
}
/**
* An interface representing LanguagesResultDictionaryLanguageCode.
*/
export interface LanguagesResultDictionaryLanguageCode {
name?: string;
nativeName?: string;
dir?: string;
translations?: LanguagesResultDictionaryLanguageCodeTranslationsItem[];
}
/**
* An interface representing LanguagesResultDictionary.
*/
export interface LanguagesResultDictionary {
languageCode?: LanguagesResultDictionaryLanguageCode;
}
/**
* Example of a successful languages request
*/
export interface LanguagesResult {
translation?: LanguagesResultTranslation;
transliteration?: LanguagesResultTransliteration;
dictionary?: LanguagesResultDictionary;
}
/**
* An interface representing DictionaryExampleResultItemExamplesItem.
*/
export interface DictionaryExampleResultItemExamplesItem {
sourcePrefix?: string;
sourceTerm?: string;
sourceSuffix?: string;
targetPrefix?: string;
targetTerm?: string;
targetSuffix?: string;
}
/**
* An interface representing DictionaryExampleResultItem.
*/
export interface DictionaryExampleResultItem {
normalizedSource?: string;
normalizedTarget?: string;
examples?: DictionaryExampleResultItemExamplesItem[];
}
/**
* An interface representing DictionaryLookupResultItemTranslationsItemBackTranslationsItem.
*/
export interface DictionaryLookupResultItemTranslationsItemBackTranslationsItem {
normalizedText?: string;
displayText?: string;
numExamples?: number;
frequencyCount?: number;
}
/**
* An interface representing DictionaryLookupResultItemTranslationsItem.
*/
export interface DictionaryLookupResultItemTranslationsItem {
normalizedTarget?: string;
displayTarget?: string;
posTag?: string;
confidence?: number;
prefixWord?: string;
backTranslations?: DictionaryLookupResultItemTranslationsItemBackTranslationsItem[];
}
/**
* An interface representing DictionaryLookupResultItem.
*/
export interface DictionaryLookupResultItem {
normalizedSource?: string;
displaySource?: string;
translations?: DictionaryLookupResultItemTranslationsItem[];
}
/**
* An interface representing TranslateResultItemTranslationItem.
*/
export interface TranslateResultItemTranslationItem {
text?: string;
to?: string;
}
/**
* An interface representing TranslateResultItem.
*/
export interface TranslateResultItem {
translation?: TranslateResultItemTranslationItem[];
}
/**
* An interface representing TranslateResultAllItemDetectedLanguage.
*/
export interface TranslateResultAllItemDetectedLanguage {
language?: string;
score?: number;
}
/**
* An interface representing TranslateResultAllItemTranslationsItemTransliteration.
*/
export interface TranslateResultAllItemTranslationsItemTransliteration {
text?: string;
script?: string;
}
/**
* An interface representing TranslateResultAllItemTranslationsItemAlignment.
*/
export interface TranslateResultAllItemTranslationsItemAlignment {
proj?: string;
}
/**
* An interface representing TranslateResultAllItemTranslationsItemSentLenSrcSentLenItem.
*/
export interface TranslateResultAllItemTranslationsItemSentLenSrcSentLenItem {
integer?: number;
}
/**
* An interface representing TranslateResultAllItemTranslationsItemSentLenTransSentLenItem.
*/
export interface TranslateResultAllItemTranslationsItemSentLenTransSentLenItem {
integer?: number;
}
/**
* An interface representing TranslateResultAllItemTranslationsItemSentLen.
*/
export interface TranslateResultAllItemTranslationsItemSentLen {
srcSentLen?: TranslateResultAllItemTranslationsItemSentLenSrcSentLenItem[];
transSentLen?: TranslateResultAllItemTranslationsItemSentLenTransSentLenItem[];
}
/**
* An interface representing TranslateResultAllItemTranslationsItem.
*/
export interface TranslateResultAllItemTranslationsItem {
text?: string;
transliteration?: TranslateResultAllItemTranslationsItemTransliteration;
to?: string;
alignment?: TranslateResultAllItemTranslationsItemAlignment;
sentLen?: TranslateResultAllItemTranslationsItemSentLen;
}
/**
* An interface representing TranslateResultAllItem.
*/
export interface TranslateResultAllItem {
detectedLanguage?: TranslateResultAllItemDetectedLanguage;
translations?: TranslateResultAllItemTranslationsItem[];
}
/**
* An interface representing BreakSentenceResultItem.
*/
export interface BreakSentenceResultItem {
sentLen?: number[];
}
/**
* An interface representing TransliterateResultItem.
*/
export interface TransliterateResultItem {
text?: string;
script?: string;
}
/**
* An interface representing DetectResultItem.
*/
export interface DetectResultItem {
text?: string;
}
/**
* Text needed for break sentence request
*/
export interface BreakSentenceTextInput {
text?: string;
}
/**
* An interface representing ErrorMessageError.
*/
export interface ErrorMessageError {
code?: string;
message?: string;
}
/**
* An interface representing ErrorMessage.
*/
export interface ErrorMessage {
error?: ErrorMessageError;
}
/**
* Text needed for detect request
*/
export interface DetectTextInput {
text?: string;
}
/**
* Text needed for a dictionary lookup request
*/
export interface DictionaryLookupTextInput {
text?: string;
}
/**
* Text needed for a dictionary example request
*/
export interface DictionaryExampleTextInput {
text?: string;
translation?: string;
}
/**
* Text needed for a translate request
*/
export interface TranslateTextInput {
text?: string;
}
/**
* Text needed for a transliterate request
*/
export interface TransliterateTextInput {
text?: string;
}
/**
* An interface representing TranslatorTextClientOptions.
*/
export interface TranslatorTextClientOptions extends ServiceClientOptions {
/**
* Version of the API requested by the client. Value must be **3.0**. Default value: '3.0'.
*/
apiVersion?: string;
}
/**
* Optional Parameters.
*/
export interface TranslatorBreakSentenceOptionalParams extends msRest.RequestOptionsBase {
/**
* Language tag of the language of the input text. If not specified, Translator will apply
* automatic language detection.
*/
language?: string;
/**
* Script identifier of the script used by the input text. If a script is not specified, the
* default script of the language will be assumed.
*/
script?: string;
/**
* A client-generated GUID to uniquely identify the request. Note that you can omit this header
* if you include the trace ID in the query string using a query parameter named ClientTraceId.
*/
xClientTraceId?: string;
}
/**
* Optional Parameters.
*/
export interface TranslatorDetectOptionalParams extends msRest.RequestOptionsBase {
/**
* A client-generated GUID to uniquely identify the request. Note that you can omit this header
* if you include the trace ID in the query string using a query parameter named ClientTraceId.
*/
xClientTraceId?: string;
}
/**
* Optional Parameters.
*/
export interface TranslatorDictionaryLookupOptionalParams extends msRest.RequestOptionsBase {
/**
* A client-generated GUID to uniquely identify the request. Note that you can omit this header
* if you include the trace ID in the query string using a query parameter named ClientTraceId.
*/
xClientTraceId?: string;
}
/**
* Optional Parameters.
*/
export interface TranslatorDictionaryExamplesOptionalParams extends msRest.RequestOptionsBase {
/**
* A client-generated GUID to uniquely identify the request. Note that you can omit this header
* if you include the trace ID in the query string using a query parameter named ClientTraceId.
*/
xClientTraceId?: string;
}
/**
* Optional Parameters.
*/
export interface TranslatorLanguagesOptionalParams extends msRest.RequestOptionsBase {
/**
* 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.
*/
scope?: string[];
/**
* 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;
/**
* A client-generated GUID to uniquely identify the request. Note that you can omit this header
* if you include the trace ID in the query string using a query parameter named ClientTraceId.
*/
xClientTraceId?: string;
}
/**
* Optional Parameters.
*/
export interface TranslatorTranslateOptionalParams extends msRest.RequestOptionsBase {
/**
* Specifies the language of the input text. Find which languages are available to translate from
* by using the languages method. If the `from` parameter is not specified, automatic language
* detection is applied to determine the source language.
*/
from?: string;
/**
* Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a
* well-formed, complete HTML element. Possible values are `plain` (default) or `html`
* . Possible values include: 'plain', 'html'
*/
textType?: TextType;
/**
* A string specifying the category (domain) of the translation. This parameter retrieves
* translations from a customized system built with Custom Translator. Default value is
* `general`.
*/
category?: string;
/**
* Specifies how profanities should be treated in translations. Possible values are: `NoAction`
* (default), `Marked` or `Deleted`.
* ### Handling Profanity
* Normally the Translator service will retain profanity that is present in the source in the
* translation. The degree of profanity and the context that makes words profane differ between
* cultures, and as a result the degree of profanity in the target language may be amplified or
* reduced.
*
* If you want to avoid getting profanity in the translation, regardless of the presence of
* profanity in the source text, you can use the profanity filtering option. The option allows
* you to choose whether you want to see profanity deleted, whether you want to mark profanities
* with appropriate tags (giving you the option to add your own post-processing), or you want no
* action taken. The accepted values of `ProfanityAction` are `Deleted`, `Marked` and `NoAction`
* (default).
*
* | ProfanityAction | Action
* |
* | ---------- | ----------
* |
* | `NoAction` | This is the default behavior. Profanity will pass from source to target.
* |
* | | Example Source (Japanese)- 彼はジャッカスです。 |
* | | Example Translation (English)- He is a jackass.
* |
* | |
* |
* | `Deleted` | Profane words will be removed from the output without replacement.
* |
* | | Example Source (Japanese)- 彼はジャッカスです。 |
* | | Example Translation (English)- He is a.
* |
* | `Marked` | Profane words are replaced by a marker in the output. The marker depends
* on the `ProfanityMarker` parameter.
* | | For `ProfanityMarker=Asterisk`, profane words are replaced with `***`
* |
* | | Example Source (Japanese)- 彼はジャッカスです。 |
* | | Example Translation (English)- He is a ***.
* |
* | | For `ProfanityMarker=Tag`, profane words are surrounded by XML tags
* and
* | | Example Source (Japanese)- 彼はジャッカスです。 |
* | | Example Translation (English)- He is a jackass.
* . Possible values include: 'NoAction', 'Marked', 'Deleted'
*/
profanityAction?: ProfanityAction;
/**
* Specifies how profanities should be marked in translations. Possible values are- `Asterisk`
* (default) or `Tag`.
*/
profanityMarker?: string;
/**
* Specifies whether to include alignment projection from source text to translated text.
* Possible values are- `true` or `false` (default).
*/
includeAlignment?: boolean;
/**
* Specifies whether to include sentence boundaries for the input text and the translated text.
* Possible values are- `true` or `false` (default).
*/
includeSentenceLength?: boolean;
/**
* Specifies a fallback language if the language of the input text can't be identified. Language
* auto-detection is applied when the `from` parameter is omitted. If detection fails, the
* `suggestedFrom` language will be assumed.
*/
suggestedFrom?: string;
/**
* Specifies the script of the input text. Supported scripts are available from the languages
* method
*/
fromScript?: string;
/**
* Specifies the script of the translated text. Supported scripts are available from the
* languages method
*/
toScript?: string[];
/**
* A client-generated GUID to uniquely identify the request. Note that you can omit this header
* if you include the trace ID in the query string using a query parameter named ClientTraceId.
*/
xClientTraceId?: string;
}
/**
* Optional Parameters.
*/
export interface TranslatorTransliterateOptionalParams extends msRest.RequestOptionsBase {
/**
* A client-generated GUID to uniquely identify the request. Note that you can omit this header
* if you include the trace ID in the query string using a query parameter named ClientTraceId.
*/
xClientTraceId?: string;
}
/**
* Defines values for TextType.
* Possible values include: 'plain', 'html'
* @readonly
* @enum {string}
*/
export declare type TextType = 'plain' | 'html';
/**
* Defines values for ProfanityAction.
* Possible values include: 'NoAction', 'Marked', 'Deleted'
* @readonly
* @enum {string}
*/
export declare type ProfanityAction = 'NoAction' | 'Marked' | 'Deleted';
/**
* Contains response data for the breakSentence operation.
*/
export declare type TranslatorBreakSentenceResponse = Array & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: BreakSentenceResultItem[];
};
};
/**
* Contains response data for the detect operation.
*/
export declare type TranslatorDetectResponse = Array & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: DetectResultItem[];
};
};
/**
* Contains response data for the dictionaryLookup operation.
*/
export declare type TranslatorDictionaryLookupResponse = Array & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: DictionaryLookupResultItem[];
};
};
/**
* Contains response data for the dictionaryExamples operation.
*/
export declare type TranslatorDictionaryExamplesResponse = Array & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: DictionaryExampleResultItem[];
};
};
/**
* Contains response data for the languages operation.
*/
export declare type TranslatorLanguagesResponse = LanguagesResult & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: LanguagesResult;
};
};
/**
* Contains response data for the translate operation.
*/
export declare type TranslatorTranslateResponse = Array & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: TranslateResultAllItem[];
};
};
/**
* Contains response data for the transliterate operation.
*/
export declare type TranslatorTransliterateResponse = Array & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: TransliterateResultItem[];
};
};
//# sourceMappingURL=index.d.ts.map