Watson Developer Cloud Unity SDK  1.0.0
The Unity SDK uses the Watson Developer Cloud services, a collection of REST APIs and SDKs that use cognitive computing to solve complex problems.
IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator Class Reference

This class wraps the Language Translator service. Language Translator Service More...

Inheritance diagram for IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator:
IBM.Watson.DeveloperCloud.Services.IWatsonService

Public Types

enum  TypeFilter { TypeFilter.DEFAULT, TypeFilter.NON_DEFAULT, TypeFilter.ALL }
 This determines the types of models to return with GetModels. More...
 

Public Member Functions

delegate void GetModelsCallback (TranslationModels models, string customData)
 Callback for GetModels() method. More...
 
delegate void GetModelCallback (TranslationModel model, string customData)
 Callback for GetModel() method. More...
 
delegate void DeleteModelCallback (bool success, string customData)
 Callback for DeleteModel() method. More...
 
delegate void GetLanguagesCallback (Languages languages, string customData)
 Callback for GetLanguages() method. More...
 
delegate void IdentifyCallback (string languages, string customData)
 Callback for Identify() method. More...
 
delegate void TranslateCallback (Translations translation, string customData)
 Callback for Translate() method. More...
 
 LanguageTranslator (Credentials credentials)
 
bool GetTranslation (string text, string model_id, TranslateCallback callback)
 Translate the provided text using the specified model. More...
 
bool GetTranslation (string text, string source, string target, TranslateCallback callback)
 Translate the provided text using the specified source and target. More...
 
bool GetModels (GetModelsCallback callback, string sourceFilter=null, string targetFilter=null, TypeFilter defaults=TypeFilter.ALL)
 Retrieve the translation models with optional filters. More...
 
bool GetModel (GetModelCallback callback, string model_id)
 Get a specific model by it's ID. More...
 
delegate void OnCreateModel (TranslationModel resp, string customData)
 The callback used by CreateModel More...
 
bool CreateModel (OnCreateModel callback, string baseModelId, string customModelName, string forcedGlossaryFilePath=default(string), string parallelCorpusFilePath=default(string), string monolingualCorpusFilePath=default(string), string customData=default(string))
 Uploads a TMX glossary file on top of a domain to customize a translation model. More...
 
bool DeleteModel (DeleteModelCallback callback, string model_id)
 Delete a specific model by it's ID. More...
 
bool GetLanguages (GetLanguagesCallback callback)
 This function returns a list to the callback of all identifiable languages. More...
 
bool Identify (IdentifyCallback callback, string text)
 Identifies a language from the given text. More...
 
string GetServiceID ()
 <exclude> More...
 

Properties

string Url [get, set]
 Gets and sets the endpoint URL for the service. More...
 
Credentials Credentials [get, set]
 Gets and sets the credentials of the service. Replace the default endpoint if endpoint is defined. More...
 

Detailed Description

This class wraps the Language Translator service. Language Translator Service

Member Enumeration Documentation

This determines the types of models to return with GetModels.

Enumerator
DEFAULT 

Default types

NON_DEFAULT 

Non-Default types

ALL 

All types are returned.

Constructor & Destructor Documentation

IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.LanguageTranslator ( Credentials  credentials)
inline

Member Function Documentation

bool IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.CreateModel ( OnCreateModel  callback,
string  baseModelId,
string  customModelName,
string  forcedGlossaryFilePath = default(string),
string  parallelCorpusFilePath = default(string),
string  monolingualCorpusFilePath = default(string),
string  customData = default(string) 
)
inline

Uploads a TMX glossary file on top of a domain to customize a translation model.

Parameters
callbackThe OnCreateModel callback.
baseModelIdSpecifies the domain model that is used as the base for the training. To see current supported domain models, use the GET /v2/models parameter..
customModelNameThe model name. Valid characters are letters, numbers, -, and _. No spaces.
forcedGlossaryFilePathA TMX file with your customizations. The customizations in the file completely overwrite the domain data translation, including high frequency or high confidence phrase translations. You can upload only one glossary with a file size less than 10 MB per call.
parallelCorpusFilePathA TMX file that contains entries that are treated as a parallel corpus instead of a glossary.
monolingualCorpusFilePathA UTF-8 encoded plain text file that is used to customize the target language model.
customDataUser defined custom string data.
Returns
True if the call succeeded, false if the call fails.
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.DeleteModel ( DeleteModelCallback  callback,
string  model_id 
)
inline

Delete a specific model by it's ID.

Parameters
model_idThe model to delete.
callbackThe DeleteModel callback.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.DeleteModelCallback ( bool  success,
string  customData 
)

Callback for DeleteModel() method.

Parameters
successWas the model deleted?
customDataUser defined custom data
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetLanguages ( GetLanguagesCallback  callback)
inline

This function returns a list to the callback of all identifiable languages.

Parameters
callbackThe callback to invoke with a Language array, null on error.
Returns
Returns true if the request was submitted.
delegate void IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetLanguagesCallback ( Languages  languages,
string  customData 
)

Callback for GetLanguages() method.

Parameters
languages
customDataUser defined custom data
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetModel ( GetModelCallback  callback,
string  model_id 
)
inline

Get a specific model by it's ID.

Parameters
model_id
callback
Returns
delegate void IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetModelCallback ( TranslationModel  model,
string  customData 
)

Callback for GetModel() method.

Parameters
model
customDataUser defined custom data
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetModels ( GetModelsCallback  callback,
string  sourceFilter = null,
string  targetFilter = null,
TypeFilter  defaults = TypeFilter.ALL 
)
inline

Retrieve the translation models with optional filters.

Parameters
callbackThe callback to invoke with the array of models.
sourceFilterOptional source language filter.
targetFilterOptional target language filter.
defaultsControls if we get default, non-default, or all models.
Returns
Returns a true on success, false if it failed to submit the request.
delegate void IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetModelsCallback ( TranslationModels  models,
string  customData 
)

Callback for GetModels() method.

Parameters
models
customDataUser defined custom data
string IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetServiceID ( )
inline
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetTranslation ( string  text,
string  model_id,
TranslateCallback  callback 
)
inline

Translate the provided text using the specified model.

Parameters
textThe text to translate.
model_idThe ID of the model to use.
callbackThe callback to receive the translated text.
Returns
Returns true on success.
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.GetTranslation ( string  text,
string  source,
string  target,
TranslateCallback  callback 
)
inline

Translate the provided text using the specified source and target.

Parameters
textThe text to translate.
sourceThe ID of the source language.
targetThe ID of the target language.
callbackThe callback to receive the translated text.
Returns
Returns true on success.
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.Identify ( IdentifyCallback  callback,
string  text 
)
inline

Identifies a language from the given text.

Parameters
textThe text sample to ID.
callbackThe callback to receive the results.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.IdentifyCallback ( string  languages,
string  customData 
)

Callback for Identify() method.

Parameters
languages
customDataUser defined custom data
delegate void IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.OnCreateModel ( TranslationModel  resp,
string  customData 
)

The callback used by CreateModel

Parameters
respThe TranslationModel response.
customDataOptional custom data.
delegate void IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.TranslateCallback ( Translations  translation,
string  customData 
)

Callback for Translate() method.

Parameters
translation
customDataUser defined custom data

Property Documentation

Credentials IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.Credentials
getset

Gets and sets the credentials of the service. Replace the default endpoint if endpoint is defined.

string IBM.Watson.DeveloperCloud.Services.LanguageTranslator.v2.LanguageTranslator.Url
getset

Gets and sets the endpoint URL for the service.


The documentation for this class was generated from the following file: