你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ITextModeration.DetectLanguageWithHttpMessagesAsync 方法

定义

此操作检测给定输入内容的语言。 返回 <href=“http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 代码</a> ,用于构成所提交文本的主要语言。 支持 110 多种语言。

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Azure.CognitiveServices.ContentModerator.Models.DetectedLanguage>> DetectLanguageWithHttpMessagesAsync (string textContentType, System.IO.Stream textContent, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DetectLanguageWithHttpMessagesAsync : string * System.IO.Stream * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Azure.CognitiveServices.ContentModerator.Models.DetectedLanguage>>
Public Function DetectLanguageWithHttpMessagesAsync (textContentType As String, textContent As Stream, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of DetectedLanguage))

参数

textContentType
String

内容类型。 可能的值包括:“text/plain”、“text/html”、“text/xml”、“text/markdown”

textContent
Stream

内容到屏幕。

customHeaders
Dictionary<String,List<String>>

将添加到请求的标头。

cancellationToken
CancellationToken

取消标记。

返回

例外

操作返回无效状态代码时引发

无法反序列化响应时引发

当所需的参数为 null 时引发

适用于