public class TranslateTextRequest extends AmazonWebServiceRequest implements Serializable
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.
| Constructor and Description |
|---|
TranslateTextRequest() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getSourceLanguageCode()
The language code for the language of the source text.
|
String |
getTargetLanguageCode()
The language code requested for the language of the target text.
|
List<String> |
getTerminologyNames()
The TerminologyNames list that is taken as input to the TranslateText
request.
|
String |
getText()
The text to translate.
|
int |
hashCode() |
void |
setSourceLanguageCode(String sourceLanguageCode)
The language code for the language of the source text.
|
void |
setTargetLanguageCode(String targetLanguageCode)
The language code requested for the language of the target text.
|
void |
setTerminologyNames(Collection<String> terminologyNames)
The TerminologyNames list that is taken as input to the TranslateText
request.
|
void |
setText(String text)
The text to translate.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
TranslateTextRequest |
withSourceLanguageCode(String sourceLanguageCode)
The language code for the language of the source text.
|
TranslateTextRequest |
withTargetLanguageCode(String targetLanguageCode)
The language code requested for the language of the target text.
|
TranslateTextRequest |
withTerminologyNames(Collection<String> terminologyNames)
The TerminologyNames list that is taken as input to the TranslateText
request.
|
TranslateTextRequest |
withTerminologyNames(String... terminologyNames)
The TerminologyNames list that is taken as input to the TranslateText
request.
|
TranslateTextRequest |
withText(String text)
The text to translate.
|
clone, copyBaseTo, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollectorpublic String getText()
The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.
Constraints:
Length: 1 - 5000
Pattern: [\P{M}\p{M}]{1,5000}
The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.
public void setText(String text)
The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.
Constraints:
Length: 1 - 5000
Pattern: [\P{M}\p{M}]{1,5000}
text - The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.
public TranslateTextRequest withText(String text)
The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 5000
Pattern: [\P{M}\p{M}]{1,5000}
text - The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.
public List<String> getTerminologyNames()
The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.
The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.
public void setTerminologyNames(Collection<String> terminologyNames)
The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.
terminologyNames - The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.
public TranslateTextRequest withTerminologyNames(String... terminologyNames)
The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.
Returns a reference to this object so that method calls can be chained together.
terminologyNames - The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.
public TranslateTextRequest withTerminologyNames(Collection<String> terminologyNames)
The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.
Returns a reference to this object so that method calls can be chained together.
terminologyNames - The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.
public String getSourceLanguageCode()
The language code for the language of the source text. The language must be a language supported by Amazon Translate.
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.
Constraints:
Length: 2 - 5
The language code for the language of the source text. The language must be a language supported by Amazon Translate.
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.
public void setSourceLanguageCode(String sourceLanguageCode)
The language code for the language of the source text. The language must be a language supported by Amazon Translate.
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.
Constraints:
Length: 2 - 5
sourceLanguageCode - The language code for the language of the source text. The language must be a language supported by Amazon Translate.
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.
public TranslateTextRequest withSourceLanguageCode(String sourceLanguageCode)
The language code for the language of the source text. The language must be a language supported by Amazon Translate.
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.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 2 - 5
sourceLanguageCode - The language code for the language of the source text. The language must be a language supported by Amazon Translate.
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.
public String getTargetLanguageCode()
The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
Constraints:
Length: 2 - 5
The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
public void setTargetLanguageCode(String targetLanguageCode)
The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
Constraints:
Length: 2 - 5
targetLanguageCode - The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
public TranslateTextRequest withTargetLanguageCode(String targetLanguageCode)
The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 2 - 5
targetLanguageCode - The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
public String toString()
toString in class ObjectObject.toString()Copyright © 2019. All rights reserved.