@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AmazonTranslateClient extends AmazonWebServiceClient implements AmazonTranslate
Provides translation between one source language and another of the same set of languages.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Modifier and Type | Method and Description |
---|---|
static AmazonTranslateClientBuilder |
builder() |
DeleteTerminologyResult |
deleteTerminology(DeleteTerminologyRequest request)
A synchronous action that deletes a custom terminology.
|
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.
|
GetTerminologyResult |
getTerminology(GetTerminologyRequest request)
Retrieves a custom terminology.
|
ImportTerminologyResult |
importTerminology(ImportTerminologyRequest request)
Creates or updates a custom terminology, depending on whether or not one already exists for the given terminology
name.
|
ListTerminologiesResult |
listTerminologies(ListTerminologiesRequest request)
Provides a list of custom terminologies associated with your account.
|
TranslateTextResult |
translateText(TranslateTextRequest request)
Translates input text from the source language to the target language.
|
addRequestHandler, addRequestHandler, configureRegion, getClientConfiguration, getEndpointPrefix, getMonitoringListeners, 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 DeleteTerminologyResult deleteTerminology(DeleteTerminologyRequest request)
A synchronous action that deletes a custom terminology.
deleteTerminology
in interface AmazonTranslate
deleteTerminologyRequest
- ResourceNotFoundException
- The resource you are looking for has not been found. Review the resource you're looking for and see if a
different resource will accomplish your needs before retrying the revised request. .TooManyRequestsException
- You have made too many requests within a short period of time. Wait for a short time and then try your
request again.InternalServerException
- An internal server error occurred. Retry your request.public GetTerminologyResult getTerminology(GetTerminologyRequest request)
Retrieves a custom terminology.
getTerminology
in interface AmazonTranslate
getTerminologyRequest
- ResourceNotFoundException
- The resource you are looking for has not been found. Review the resource you're looking for and see if a
different resource will accomplish your needs before retrying the revised request. .InvalidParameterValueException
- The value of the parameter is invalid. Review the value of the parameter you are using to correct it, and
then retry your operation.TooManyRequestsException
- You have made too many requests within a short period of time. Wait for a short time and then try your
request again.InternalServerException
- An internal server error occurred. Retry your request.public ImportTerminologyResult importTerminology(ImportTerminologyRequest request)
Creates or updates a custom terminology, depending on whether or not one already exists for the given terminology name. Importing a terminology with the same name as an existing one will merge the terminologies based on the chosen merge strategy. Currently, the only supported merge strategy is OVERWRITE, and so the imported terminology will overwrite an existing terminology of the same name.
If you import a terminology that overwrites an existing one, the new terminology take up to 10 minutes to fully propagate and be available for use in a translation due to cache policies with the DataPlane service that performs the translations.
importTerminology
in interface AmazonTranslate
importTerminologyRequest
- InvalidParameterValueException
- The value of the parameter is invalid. Review the value of the parameter you are using to correct it, and
then retry your operation.LimitExceededException
- The specified limit has been exceeded. Review your request and retry it with a quantity below the stated
limit.TooManyRequestsException
- You have made too many requests within a short period of time. Wait for a short time and then try your
request again.InternalServerException
- An internal server error occurred. Retry your request.public ListTerminologiesResult listTerminologies(ListTerminologiesRequest request)
Provides a list of custom terminologies associated with your account.
listTerminologies
in interface AmazonTranslate
listTerminologiesRequest
- InvalidParameterValueException
- The value of the parameter is invalid. Review the value of the parameter you are using to correct it, and
then retry your operation.TooManyRequestsException
- You have made too many requests within a short period of time. Wait for a short time and then try your
request again.InternalServerException
- An internal server error occurred. Retry your request.public TranslateTextResult translateText(TranslateTextRequest request)
Translates input text from the source language to the target language. It is not necessary to use English (en) as either the source or the target language but not all language combinations are supported by Amazon Translate. For more information, see Supported Language Pairs.
Arabic (ar)
Chinese (Simplified) (zh)
Chinese (Traditional) (zh-TW)
Czech (cs)
Danish (da)
Dutch (nl)
English (en)
Finnish (fi)
French (fr)
German (de)
Hebrew (he)
Indonesian (id)
Italian (it)
Japanese (ja)
Korean (ko)
Polish (pl)
Portuguese (pt)
Russian (ru)
Spanish (es)
Swedish (sv)
Turkish (tr)
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 that you made is invalid. Check your request to determine why it's invalid and then retry the
request.TextSizeLimitExceededException
- The size of the text you submitted exceeds the size limit. Reduce the size of the text or use a smaller
document and then retry your request.TooManyRequestsException
- You have made too many requests within a short period of time. Wait for a short time and then try your
request again.UnsupportedLanguagePairException
- Amazon Translate does not support translation from the language of the source text into the requested
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.ResourceNotFoundException
- The resource you are looking for has not been found. Review the resource you're looking for and see if a
different resource will accomplish your needs before retrying the revised request. .InternalServerException
- An internal server error occurred. Retry your request.ServiceUnavailableException
- The Amazon Translate service is temporarily unavailable. Please wait a bit and then retry your request.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.