public class LanguageTranslator
extends com.ibm.cloud.sdk.core.service.BaseService
Constructor and Description |
---|
LanguageTranslator(java.lang.String versionDate)
Constructs a new `LanguageTranslator` client using the DEFAULT_SERVICE_NAME.
|
LanguageTranslator(java.lang.String versionDate,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs a new `LanguageTranslator` client with the DEFAULT_SERVICE_NAME and the specified
Authenticator.
|
LanguageTranslator(java.lang.String versionDate,
java.lang.String serviceName)
Constructs a new `LanguageTranslator` client with the specified serviceName.
|
LanguageTranslator(java.lang.String versionDate,
java.lang.String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs a new `LanguageTranslator` client with the specified Authenticator and serviceName.
|
Modifier and Type | Method and Description |
---|---|
com.ibm.cloud.sdk.core.http.ServiceCall<TranslationModel> |
createModel(CreateModelOptions createModelOptions)
Create model.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> |
deleteDocument(DeleteDocumentOptions deleteDocumentOptions)
Delete document.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResult> |
deleteModel(DeleteModelOptions deleteModelOptions)
Delete model.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DocumentStatus> |
getDocumentStatus(GetDocumentStatusOptions getDocumentStatusOptions)
Get document status.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TranslationModel> |
getModel(GetModelOptions getModelOptions)
Get model details.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.io.InputStream> |
getTranslatedDocument(GetTranslatedDocumentOptions getTranslatedDocumentOptions)
Get translated document.
|
com.ibm.cloud.sdk.core.http.ServiceCall<IdentifiedLanguages> |
identify(IdentifyOptions identifyOptions)
Identify language.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DocumentList> |
listDocuments()
List documents.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DocumentList> |
listDocuments(ListDocumentsOptions listDocumentsOptions)
List documents.
|
com.ibm.cloud.sdk.core.http.ServiceCall<IdentifiableLanguages> |
listIdentifiableLanguages()
List identifiable languages.
|
com.ibm.cloud.sdk.core.http.ServiceCall<IdentifiableLanguages> |
listIdentifiableLanguages(ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions)
List identifiable languages.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TranslationModels> |
listModels()
List models.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TranslationModels> |
listModels(ListModelsOptions listModelsOptions)
List models.
|
com.ibm.cloud.sdk.core.http.ServiceCall<TranslationResult> |
translate(TranslateOptions translateOptions)
Translate.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DocumentStatus> |
translateDocument(TranslateDocumentOptions translateDocumentOptions)
Translate document.
|
configureClient, configureHttpClient, configureService, createServiceCall, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, processServiceCall, setAuthentication, setClient, setDefaultHeaders, setDefaultHeaders, setEndPoint, setServiceUrl, toString
public LanguageTranslator(java.lang.String versionDate)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.public LanguageTranslator(java.lang.String versionDate, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.authenticator
- the Authenticator instance to be configured for this servicepublic LanguageTranslator(java.lang.String versionDate, java.lang.String serviceName)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.serviceName
- The name of the service to configure.public LanguageTranslator(java.lang.String versionDate, java.lang.String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.serviceName
- The name of the service to configure.authenticator
- the Authenticator instance to be configured for this servicepublic com.ibm.cloud.sdk.core.http.ServiceCall<TranslationResult> translate(TranslateOptions translateOptions)
Translates the input text from the source language to the target language. A target language or translation model ID is required. The service attempts to detect the language of the source text if it is not specified.
translateOptions
- the TranslateOptions
containing the options for the callServiceCall
with a response type of TranslationResult
public com.ibm.cloud.sdk.core.http.ServiceCall<IdentifiableLanguages> listIdentifiableLanguages(ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions)
Lists the languages that the service can identify. Returns the language code (for example, `en` for English or `es` for Spanish) and name of each language.
listIdentifiableLanguagesOptions
- the ListIdentifiableLanguagesOptions
containing
the options for the callServiceCall
with a response type of IdentifiableLanguages
public com.ibm.cloud.sdk.core.http.ServiceCall<IdentifiableLanguages> listIdentifiableLanguages()
Lists the languages that the service can identify. Returns the language code (for example, `en` for English or `es` for Spanish) and name of each language.
ServiceCall
with a response type of IdentifiableLanguages
public com.ibm.cloud.sdk.core.http.ServiceCall<IdentifiedLanguages> identify(IdentifyOptions identifyOptions)
Identifies the language of the input text.
identifyOptions
- the IdentifyOptions
containing the options for the callServiceCall
with a response type of IdentifiedLanguages
public com.ibm.cloud.sdk.core.http.ServiceCall<TranslationModels> listModels(ListModelsOptions listModelsOptions)
Lists available translation models.
listModelsOptions
- the ListModelsOptions
containing the options for the callServiceCall
with a response type of TranslationModels
public com.ibm.cloud.sdk.core.http.ServiceCall<TranslationModels> listModels()
Lists available translation models.
ServiceCall
with a response type of TranslationModels
public com.ibm.cloud.sdk.core.http.ServiceCall<TranslationModel> createModel(CreateModelOptions createModelOptions)
Uploads Translation Memory eXchange (TMX) files to customize a translation model.
You can either customize a model with a forced glossary or with a corpus that contains parallel sentences. To create a model that is customized with a parallel corpus and a forced glossary, proceed in two steps: customize with a parallel corpus first and then customize the resulting model with a glossary. Depending on the type of customization and the size of the uploaded corpora, training can range from minutes for a glossary to several hours for a large parallel corpus. You can upload a single forced glossary file and this file must be less than 10 MB. You can upload multiple parallel corpora tmx files. The cumulative file size of all uploaded files is limited to 250 MB. To successfully train with a parallel corpus you must have at least 5,000 parallel sentences in your corpus.
You can have a maximum of 10 custom models per language pair.
createModelOptions
- the CreateModelOptions
containing the options for the callServiceCall
with a response type of TranslationModel
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResult> deleteModel(DeleteModelOptions deleteModelOptions)
Deletes a custom translation model.
deleteModelOptions
- the DeleteModelOptions
containing the options for the callServiceCall
with a response type of DeleteModelResult
public com.ibm.cloud.sdk.core.http.ServiceCall<TranslationModel> getModel(GetModelOptions getModelOptions)
Gets information about a translation model, including training status for custom models. Use this API call to poll the status of your customization request. A successfully completed training will have a status of `available`.
getModelOptions
- the GetModelOptions
containing the options for the callServiceCall
with a response type of TranslationModel
public com.ibm.cloud.sdk.core.http.ServiceCall<DocumentList> listDocuments(ListDocumentsOptions listDocumentsOptions)
Lists documents that have been submitted for translation.
listDocumentsOptions
- the ListDocumentsOptions
containing the options for the
callServiceCall
with a response type of DocumentList
public com.ibm.cloud.sdk.core.http.ServiceCall<DocumentList> listDocuments()
Lists documents that have been submitted for translation.
ServiceCall
with a response type of DocumentList
public com.ibm.cloud.sdk.core.http.ServiceCall<DocumentStatus> translateDocument(TranslateDocumentOptions translateDocumentOptions)
Submit a document for translation. You can submit the document contents in the `file` parameter, or you can reference a previously submitted document by document ID.
translateDocumentOptions
- the TranslateDocumentOptions
containing the options for
the callServiceCall
with a response type of DocumentStatus
public com.ibm.cloud.sdk.core.http.ServiceCall<DocumentStatus> getDocumentStatus(GetDocumentStatusOptions getDocumentStatusOptions)
Gets the translation status of a document.
getDocumentStatusOptions
- the GetDocumentStatusOptions
containing the options for
the callServiceCall
with a response type of DocumentStatus
public com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> deleteDocument(DeleteDocumentOptions deleteDocumentOptions)
Deletes a document.
deleteDocumentOptions
- the DeleteDocumentOptions
containing the options for the
callServiceCall
with a response type of Voidpublic com.ibm.cloud.sdk.core.http.ServiceCall<java.io.InputStream> getTranslatedDocument(GetTranslatedDocumentOptions getTranslatedDocumentOptions)
Gets the translated document associated with the given document ID.
getTranslatedDocumentOptions
- the GetTranslatedDocumentOptions
containing the
options for the callServiceCall
with a response type of InputStream