Class TranslateOptions

java.lang.Object
com.ibm.cloud.sdk.core.service.model.GenericModel
com.ibm.watson.language_translator.v3.model.TranslateOptions
All Implemented Interfaces:
com.ibm.cloud.sdk.core.service.model.ObjectModel

public class TranslateOptions
extends com.ibm.cloud.sdk.core.service.model.GenericModel
The translate options.
  • Method Details

    • newBuilder

      public TranslateOptions.Builder newBuilder()
      New builder.
      Returns:
      a TranslateOptions builder
    • text

      public List<String> text()
      Gets the text.

      Input text in UTF-8 encoding. Submit a maximum of 50 KB (51,200 bytes) of text with a single request. Multiple elements result in multiple translations in the response.

      Returns:
      the text
    • modelId

      public String modelId()
      Gets the modelId.

      The model to use for translation. For example, `en-de` selects the IBM-provided base model for English-to-German translation. A model ID overrides the `source` and `target` parameters and is required if you use a custom model. If no model ID is specified, you must specify at least a target language.

      Returns:
      the modelId
    • source

      public String source()
      Gets the source.

      Language code that specifies the language of the input text. If omitted, the service derives the source language from the input text. The input must contain sufficient text for the service to identify the language reliably.

      Returns:
      the source
    • target

      public String target()
      Gets the target.

      Language code that specifies the target language for translation. Required if model ID is not specified.

      Returns:
      the target