@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AmazonTranslateClient extends AmazonWebServiceClient implements AmazonTranslate
Provides translation between English and one of six languages, or between one of the six languages and English.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Modifier and Type | Method and Description |
---|---|
static AmazonTranslateClientBuilder |
builder() |
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for debugging issues
where a service isn't acting as expected.
|
TranslateTextResult |
translateText(TranslateTextRequest request)
Translates input text from the source language to the target language.
|
addRequestHandler, addRequestHandler, configureRegion, getEndpointPrefix, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withEndpoint, withRegion, withRegion, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
shutdown
public static AmazonTranslateClientBuilder builder()
public TranslateTextResult translateText(TranslateTextRequest request)
Translates input text from the source language to the target language. You can translate between English (en) and one of the following languages, or between one of the following languages and English.
Arabic (ar)
Chinese (Simplified) (zh)
French (fr)
German (de)
Portuguese (pt)
Spanish (es)
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.
translateText
in interface AmazonTranslate
translateTextRequest
- InvalidRequestException
- The request is invalid.TextSizeLimitExceededException
- The size of the input text exceeds the length constraint for the Text
field. Try again with
a shorter text.TooManyRequestsException
- The number of requests exceeds the limit. Resubmit your request later.UnsupportedLanguagePairException
- Amazon Translate cannot translate input text in the source language into this target language. For more
information, see how-to-error-msg.DetectedLanguageLowConfidenceException
- The confidence that Amazon Comprehend accurately detected the source language is low. If a low confidence
level is acceptable for your application, you can use the language in the exception to call Amazon
Translate again. For more information, see the DetectDominantLanguage operation in the Amazon Comprehend Developer Guide.InternalServerException
- An internal server error occurred. Retry your request.ServiceUnavailableException
- Amazon Translate is unavailable. Retry your request later.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AmazonTranslate
request
- The originally executed requestCopyright © 2013 Amazon Web Services, Inc. All Rights Reserved.