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.LanguageTranslation.v2.LanguageTranslation Class Reference

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

Inheritance diagram for IBM.Watson.DeveloperCloud.Services.LanguageTranslation.v2.LanguageTranslation:
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=null)
 Callback for GetModels() method. More...
 
delegate void GetModelCallback (TranslationModel model, string customData=null)
 Callback for GetModel() method. More...
 
delegate void GetLanguagesCallback (Languages languages, string customData=null)
 Callback for GetLanguages() method. More...
 
delegate void IdentifyCallback (string languages, string customData=null)
 Callback for Identify() method. More...
 
delegate void TranslateCallback (Translations translation, string customData=null)
 Callback for Translate() method. More...
 
 LanguageTranslation (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 (string model_id, GetModelCallback callback)
 Get 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 (string text, IdentifyCallback callback)
 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 Translation service. Language Translation 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.LanguageTranslation.v2.LanguageTranslation.LanguageTranslation ( Credentials  credentials)
inline

Member Function Documentation

bool IBM.Watson.DeveloperCloud.Services.LanguageTranslation.v2.LanguageTranslation.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.LanguageTranslation.v2.LanguageTranslation.GetLanguagesCallback ( Languages  languages,
string  customData = null 
)

Callback for GetLanguages() method.

Parameters
languages
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslation.v2.LanguageTranslation.GetModel ( string  model_id,
GetModelCallback  callback 
)
inline

Get a specific model by it's ID.

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

Callback for GetModel() method.

Parameters
model
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslation.v2.LanguageTranslation.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.LanguageTranslation.v2.LanguageTranslation.GetModelsCallback ( TranslationModels  models,
string  customData = null 
)

Callback for GetModels() method.

Parameters
models
string IBM.Watson.DeveloperCloud.Services.LanguageTranslation.v2.LanguageTranslation.GetServiceID ( )
inline
bool IBM.Watson.DeveloperCloud.Services.LanguageTranslation.v2.LanguageTranslation.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.LanguageTranslation.v2.LanguageTranslation.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.LanguageTranslation.v2.LanguageTranslation.Identify ( string  text,
IdentifyCallback  callback 
)
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.LanguageTranslation.v2.LanguageTranslation.IdentifyCallback ( string  languages,
string  customData = null 
)

Callback for Identify() method.

Parameters
languages
delegate void IBM.Watson.DeveloperCloud.Services.LanguageTranslation.v2.LanguageTranslation.TranslateCallback ( Translations  translation,
string  customData = null 
)

Callback for Translate() method.

Parameters
translation

Property Documentation

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

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

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

Gets and sets the endpoint URL for the service.


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