Class TranslateOptions

java.lang.Object
com.azure.ai.translation.text.models.TranslateOptions

public final class TranslateOptions extends Object
Options that may be passed when translating a text.
  • Constructor Details

    • TranslateOptions

      public TranslateOptions()
  • Method Details

    • getTargetLanguages

      public List<String> getTargetLanguages()
      Returns:
      Specifies the language of the output text.
    • setTargetLanguages

      public TranslateOptions setTargetLanguages(List<String> targetLanguages)
      Parameters:
      targetLanguages - Specifies the language of the output text.
      Returns:
      The updated options.
    • addTargetLanguage

      public TranslateOptions addTargetLanguage(String targetLanguage)
      Parameters:
      targetLanguage - Specifies the language of the output text.
      Returns:
      The updated options.
    • getSourceLanguage

      public String getSourceLanguage()
      Returns:
      Specifies the language of the input text.
    • setSourceLanguage

      public TranslateOptions setSourceLanguage(String sourceLanguage)
      Parameters:
      sourceLanguage - Specifies the language of the input text.
      Returns:
      The updated options.
    • getClientTraceId

      public String getClientTraceId()
      Returns:
      client-generated GUID to uniquely identify the request.
    • setClientTraceId

      public TranslateOptions setClientTraceId(String clientTraceId)
      Parameters:
      clientTraceId - client-generated GUID to uniquely identify the request.
      Returns:
      The updated options.
    • getTextType

      public TextType getTextType()
      Returns:
      specifies whether the text being translated is plain text or HTML text.
    • setTextType

      public TranslateOptions setTextType(TextType textType)
      Parameters:
      textType - specifies whether the text being translated is plain text or HTML text.
      Returns:
      The updated options.
    • getCategory

      public String getCategory()
      Returns:
      specifying the category (domain) of the translation.
    • setCategory

      public TranslateOptions setCategory(String category)
      Parameters:
      category - specifying the category (domain) of the translation.
      Returns:
      The updated options.
    • getProfanityAction

      public ProfanityAction getProfanityAction()
      Returns:
      specifies how profanities should be treated in translations.
    • setProfanityAction

      public TranslateOptions setProfanityAction(ProfanityAction profanityAction)
      Parameters:
      profanityAction - specifies how profanities should be treated in translations.
      Returns:
      The updated options.
    • getProfanityMarker

      public ProfanityMarker getProfanityMarker()
      Returns:
      specifies how profanities should be marked in translations.
    • setProfanityMarker

      public TranslateOptions setProfanityMarker(ProfanityMarker profanityMarker)
      Parameters:
      profanityMarker - specifies how profanities should be marked in translations.
      Returns:
      The updated options.
    • isIncludeAlignment

      public Boolean isIncludeAlignment()
      Returns:
      Whether or not to include alignment projection from source text to translated text.
    • setIncludeAlignment

      public TranslateOptions setIncludeAlignment(Boolean includeAlignment)
      Parameters:
      includeAlignment - Whether or not to include alignment projection from source text to translated text.
      Returns:
      The updated options.
    • isIncludeSentenceLength

      public Boolean isIncludeSentenceLength()
      Returns:
      Whether or not to include sentence boundaries for the input text and the translated text.
    • setIncludeSentenceLength

      public TranslateOptions setIncludeSentenceLength(Boolean includeSentenceLength)
      Parameters:
      includeSentenceLength - Whether or not to include sentence boundaries for the input text and the translated text.
      Returns:
      The updated options.
    • getSuggestedSourceLanguage

      public String getSuggestedSourceLanguage()
      Returns:
      fallback language if the language of the input text can't be identified.
    • setSuggestedSourceLanguage

      public TranslateOptions setSuggestedSourceLanguage(String suggestedSourceLanguage)
      Parameters:
      suggestedSourceLanguage - fallback language if the language of the input text can't be identified.
      Returns:
      The updated options.
    • getSourceLanguageScript

      public String getSourceLanguageScript()
      Returns:
      the script of the input text.
    • setSourceLanguageScript

      public TranslateOptions setSourceLanguageScript(String sourceLanguageScript)
      Parameters:
      sourceLanguageScript - the script of the input text.
      Returns:
      The updated options.
    • getTargetLanguageScript

      public String getTargetLanguageScript()
      Returns:
      the script of the translated text.
    • setTargetLanguageScript

      public TranslateOptions setTargetLanguageScript(String targetLanguageScript)
      Parameters:
      targetLanguageScript - the script of the translated text.
      Returns:
      The updated options.
    • isAllowFallback

      public Boolean isAllowFallback()
      Returns:
      Whether or not the service allows fallbeck for Custom Translator requests.
    • setAllowFallback

      public TranslateOptions setAllowFallback(Boolean allowFallback)
      Parameters:
      allowFallback - Whether or not the service allows fallbeck for Custom Translator requests.
      Returns:
      The updated options.