Interface TranslateRpc (2.4.0)

public interface TranslateRpc extends ServiceRpc

Implements

com.google.cloud.ServiceRpc

Methods

detect(List<String> texts)

public abstract List<List<DetectionsResourceItems>> detect(List<String> texts)

Detects the language of the provided texts.

Parameter
NameDescription
textsList<String>

the texts to translate

Returns
TypeDescription
List<List<com.google.api.services.translate.model.DetectionsResourceItems>>

a list of lists of detections, one list of detections for each provided text, in order

listSupportedLanguages(Map<TranslateRpc.Option,?> optionMap)

public abstract List<LanguagesResource> listSupportedLanguages(Map<TranslateRpc.Option,?> optionMap)

Returns a list of the languages supported by Google Translation.

Parameter
NameDescription
optionMapMap<Option,?>

options to listing language translations

Returns
TypeDescription
List<com.google.api.services.translate.model.LanguagesResource>

translate(List<String> texts, Map<TranslateRpc.Option,?> optionMap)

public abstract List<TranslationsResource> translate(List<String> texts, Map<TranslateRpc.Option,?> optionMap)

Translates the provided texts.

Parameters
NameDescription
textsList<String>

the texts to translate

optionMapMap<Option,?>

options to text translation

Returns
TypeDescription
List<com.google.api.services.translate.model.TranslationsResource>

a list of resources containing translation information, in the same order of the provided texts