public class LanguageTranslation extends WatsonService
| Modifier and Type | Field and Description |
|---|---|
static String |
BASE_MODEL_ID
The Constant BASE_MODEL_ID.
|
static String |
DEFAULT
The Constant DEFAULT.
|
static String |
FORCED_GLOSSARY
The Constant FORCED_GLOSSARY.
|
static String |
MODEL_ID
The Constant MODEL_ID.
|
static String |
NAME
The Constant NAME.
|
static String |
SOURCE
The Constant SOURCE.
|
static String |
TARGET
The Constant TARGET.
|
static String |
TEXT
The Constant TEXT.
|
FORWARD_SLASH| Constructor and Description |
|---|
LanguageTranslation()
Instantiates a new Language Translation service.
|
| Modifier and Type | Method and Description |
|---|---|
TranslationModel |
createModel(Map<String,Object> params)
Creates a translation models.
|
void |
deleteModel(String modelId)
Deletes a translation models.
|
List<IdentifiableLanguage> |
getIdentifiableLanguages()
Retrieves the list of identifiable languages.
|
TranslationModel |
getModel(String modelId)
Retrieves a translation models.
|
List<TranslationModel> |
getModels()
Retrieves the list of translation models.
|
List<TranslationModel> |
getModels(Boolean showDefault,
String source,
String target)
Retrieves the list of models.
|
List<IdentifiedLanguage> |
identify(String text)
Identify language in which text is written.
|
String |
toString() |
TranslationResult |
translate(Map<String,Object> params)
Translate paragraphs of text using a model and or source and target.
|
TranslationResult |
translate(String text,
String modelId)
Translate text using a model.
|
TranslationResult |
translate(String text,
String source,
String target)
Translate text using source and target languages.
|
execute, executeRequest, executeWithoutResponse, getApiKey, getDefaultContentType, getDefaultRequestParams, getEndPoint, getHttpClient, getThreadSafeClient, setApiKey, setAuthentication, setEndPoint, setUsernameAndPasswordpublic static final String BASE_MODEL_ID
public static final String FORCED_GLOSSARY
public static final String DEFAULT
public static final String MODEL_ID
public static final String SOURCE
public static final String TARGET
public static final String TEXT
public static final String NAME
public LanguageTranslation()
public List<IdentifiableLanguage> getIdentifiableLanguages()
TranslationModelpublic List<TranslationModel> getModels()
TranslationModelpublic TranslationModel getModel(String modelId)
modelId - the model identifierTranslationModelpublic void deleteModel(String modelId)
modelId - the model identifierpublic TranslationModel createModel(Map<String,Object> params)
params - String name the model name,
String base_model_id the model id to use as base model,
File forced_glossary the tmx file use in the modelpublic List<TranslationModel> getModels(Boolean showDefault, String source, String target)
showDefault - show default modelssource - the sourcetarget - the targetTranslationModelpublic List<IdentifiedLanguage> identify(String text)
text - the text to identifypublic String toString()
toString in class WatsonServicepublic TranslationResult translate(Map<String,Object> params)
params - the paramsTranslationResultpublic TranslationResult translate(String text, String modelId)
text - The submitted paragraphs to translatemodelId - the model idTranslationResultpublic TranslationResult translate(String text, String source, String target)
text - The submitted paragraphs to translatesource - The source languagetarget - The target languageTranslationResultCopyright © 2015. All rights reserved.