Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Translates input text from the source language to the target language. For a list of available languages and language codes, see Supported languages.
Synopsis
- data TranslateText = TranslateText' {}
- newTranslateText :: Text -> Text -> Text -> TranslateText
- translateText_settings :: Lens' TranslateText (Maybe TranslationSettings)
- translateText_terminologyNames :: Lens' TranslateText (Maybe [Text])
- translateText_text :: Lens' TranslateText Text
- translateText_sourceLanguageCode :: Lens' TranslateText Text
- translateText_targetLanguageCode :: Lens' TranslateText Text
- data TranslateTextResponse = TranslateTextResponse' {}
- newTranslateTextResponse :: Int -> Text -> Text -> Text -> TranslateTextResponse
- translateTextResponse_appliedSettings :: Lens' TranslateTextResponse (Maybe TranslationSettings)
- translateTextResponse_appliedTerminologies :: Lens' TranslateTextResponse (Maybe [AppliedTerminology])
- translateTextResponse_httpStatus :: Lens' TranslateTextResponse Int
- translateTextResponse_translatedText :: Lens' TranslateTextResponse Text
- translateTextResponse_sourceLanguageCode :: Lens' TranslateTextResponse Text
- translateTextResponse_targetLanguageCode :: Lens' TranslateTextResponse Text
Creating a Request
data TranslateText Source #
See: newTranslateText
smart constructor.
TranslateText' | |
|
Instances
Create a value of TranslateText
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
TranslateText
, translateText_settings
- Settings to configure your translation output, including the option to
set the formality level of the output text and the option to mask
profane words and phrases.
TranslateText
, translateText_terminologyNames
- The name of the terminology list file to be used in the TranslateText
request. You can use 1 terminology list at most in a TranslateText
request. Terminology lists can contain a maximum of 256 terms.
$sel:text:TranslateText'
, translateText_text
- The text to translate. The text string can be a maximum of 10,000 bytes
long. Depending on your character set, this may be fewer than 10,000
characters.
TranslateText
, translateText_sourceLanguageCode
- The language code for the language of the source text. The language must
be a language supported by Amazon Translate. For a list of language
codes, see
Supported languages.
To have Amazon Translate determine the source language of your text, you
can specify auto
in the SourceLanguageCode
field. If you specify
auto
, Amazon Translate will call
Amazon Comprehend
to determine the source language.
If you specify auto
, you must send the TranslateText
request in a
region that supports Amazon Comprehend. Otherwise, the request returns
an error indicating that autodetect is not supported.
TranslateText
, translateText_targetLanguageCode
- The language code requested for the language of the target text. The
language must be a language supported by Amazon Translate.
Request Lenses
translateText_settings :: Lens' TranslateText (Maybe TranslationSettings) Source #
Settings to configure your translation output, including the option to set the formality level of the output text and the option to mask profane words and phrases.
translateText_terminologyNames :: Lens' TranslateText (Maybe [Text]) Source #
The name of the terminology list file to be used in the TranslateText
request. You can use 1 terminology list at most in a TranslateText
request. Terminology lists can contain a maximum of 256 terms.
translateText_text :: Lens' TranslateText Text Source #
The text to translate. The text string can be a maximum of 10,000 bytes long. Depending on your character set, this may be fewer than 10,000 characters.
translateText_sourceLanguageCode :: Lens' TranslateText Text Source #
The language code for the language of the source text. The language must be a language supported by Amazon Translate. For a list of language codes, see Supported languages.
To have Amazon Translate determine the source language of your text, you
can specify auto
in the SourceLanguageCode
field. If you specify
auto
, Amazon Translate will call
Amazon Comprehend
to determine the source language.
If you specify auto
, you must send the TranslateText
request in a
region that supports Amazon Comprehend. Otherwise, the request returns
an error indicating that autodetect is not supported.
translateText_targetLanguageCode :: Lens' TranslateText Text Source #
The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
Destructuring the Response
data TranslateTextResponse Source #
See: newTranslateTextResponse
smart constructor.
TranslateTextResponse' | |
|
Instances
newTranslateTextResponse Source #
:: Int | |
-> Text | |
-> Text | |
-> Text | |
-> TranslateTextResponse |
Create a value of TranslateTextResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:appliedSettings:TranslateTextResponse'
, translateTextResponse_appliedSettings
- Settings that configure the translation output.
$sel:appliedTerminologies:TranslateTextResponse'
, translateTextResponse_appliedTerminologies
- The names of the custom terminologies applied to the input text by
Amazon Translate for the translated text response.
$sel:httpStatus:TranslateTextResponse'
, translateTextResponse_httpStatus
- The response's http status code.
$sel:translatedText:TranslateTextResponse'
, translateTextResponse_translatedText
- The translated text.
TranslateText
, translateTextResponse_sourceLanguageCode
- The language code for the language of the source text.
TranslateText
, translateTextResponse_targetLanguageCode
- The language code for the language of the target text.
Response Lenses
translateTextResponse_appliedSettings :: Lens' TranslateTextResponse (Maybe TranslationSettings) Source #
Settings that configure the translation output.
translateTextResponse_appliedTerminologies :: Lens' TranslateTextResponse (Maybe [AppliedTerminology]) Source #
The names of the custom terminologies applied to the input text by Amazon Translate for the translated text response.
translateTextResponse_httpStatus :: Lens' TranslateTextResponse Int Source #
The response's http status code.
translateTextResponse_translatedText :: Lens' TranslateTextResponse Text Source #
The translated text.
translateTextResponse_sourceLanguageCode :: Lens' TranslateTextResponse Text Source #
The language code for the language of the source text.
translateTextResponse_targetLanguageCode :: Lens' TranslateTextResponse Text Source #
The language code for the language of the target text.