public class LanguageTranslator extends WatsonService
defaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
Constructor and Description |
---|
LanguageTranslator()
Instantiates a new `LanguageTranslator`.
|
LanguageTranslator(java.lang.String username,
java.lang.String password)
Instantiates a new `LanguageTranslator` with username and password.
|
Modifier and Type | Method and Description |
---|---|
ServiceCall<TranslationModel> |
createModel(CreateModelOptions createModelOptions)
Uploads a TMX glossary file on top of a domain to customize a translation model.
|
ServiceCall<java.lang.Void> |
deleteModel(DeleteModelOptions deleteModelOptions)
Deletes a custom translation model.
|
ServiceCall<TranslationModel> |
getModel(GetModelOptions getModelOptions)
Get information about the given translation model, including training status.
|
ServiceCall<IdentifiedLanguages> |
identify(IdentifyOptions identifyOptions)
Identifies the language of the input text.
|
ServiceCall<IdentifiableLanguages> |
listIdentifiableLanguages()
Lists all languages that can be identified by the API.
|
ServiceCall<IdentifiableLanguages> |
listIdentifiableLanguages(ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions)
Lists all languages that can be identified by the API.
|
ServiceCall<TranslationModels> |
listModels()
Lists available standard and custom models by source or target language.
|
ServiceCall<TranslationModels> |
listModels(ListModelsOptions listModelsOptions)
Lists available standard and custom models by source or target language.
|
ServiceCall<TranslationResult> |
translate(TranslateOptions translateOptions)
Translates the input text from the source language to the target language.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toString
public LanguageTranslator()
public LanguageTranslator(java.lang.String username, java.lang.String password)
username
- the usernamepassword
- the passwordpublic ServiceCall<TranslationResult> translate(TranslateOptions translateOptions)
translateOptions
- the TranslateOptions
containing the options for the callServiceCall
with a response type of TranslationResult
public ServiceCall<IdentifiedLanguages> identify(IdentifyOptions identifyOptions)
identifyOptions
- the IdentifyOptions
containing the options for the callServiceCall
with a response type of IdentifiedLanguages
public ServiceCall<IdentifiableLanguages> listIdentifiableLanguages(ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions)
listIdentifiableLanguagesOptions
- the ListIdentifiableLanguagesOptions
containing the options for the
callServiceCall
with a response type of IdentifiableLanguages
public ServiceCall<IdentifiableLanguages> listIdentifiableLanguages()
ServiceCall
with a response type of IdentifiableLanguages
public ServiceCall<TranslationModel> createModel(CreateModelOptions createModelOptions)
createModelOptions
- the CreateModelOptions
containing the options for the callServiceCall
with a response type of TranslationModel
public ServiceCall<java.lang.Void> deleteModel(DeleteModelOptions deleteModelOptions)
deleteModelOptions
- the DeleteModelOptions
containing the options for the callServiceCall
with a response type of Voidpublic ServiceCall<TranslationModel> getModel(GetModelOptions getModelOptions)
getModelOptions
- the GetModelOptions
containing the options for the callServiceCall
with a response type of TranslationModel
public ServiceCall<TranslationModels> listModels(ListModelsOptions listModelsOptions)
listModelsOptions
- the ListModelsOptions
containing the options for the callServiceCall
with a response type of TranslationModels
public ServiceCall<TranslationModels> listModels()
ServiceCall
with a response type of TranslationModels