Class DetectLanguageResult

java.lang.Object
com.azure.ai.textanalytics.models.TextAnalyticsResult
com.azure.ai.textanalytics.models.DetectLanguageResult

public final class DetectLanguageResult extends TextAnalyticsResult
  • Constructor Details

    • DetectLanguageResult

      public DetectLanguageResult(String id, TextDocumentStatistics textDocumentStatistics, TextAnalyticsError error, DetectedLanguage primaryLanguage)
      Creates a DetectLanguageResult model that describes detected languages result.
      Parameters:
      id - Unique, non-empty document identifier.
      textDocumentStatistics - The text document statistics.
      error - The document error.
      primaryLanguage - The detected primary language.
  • Method Details

    • getPrimaryLanguage

      public DetectedLanguage getPrimaryLanguage()
      Gets the detected primary language.
      Returns:
      The detected language.
      Throws:
      TextAnalyticsException - if result has isError equals to true and when a non-error property was accessed.