TextModerationExtensions.DetectLanguageAsync(ITextModeration, String, Stream, CancellationToken) Method

Definition

This operation will detect the language of given input content. Returns the <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the predominant language comprising the submitted text. Over 110 languages supported.

public static System.Threading.Tasks.Task<Microsoft.Azure.CognitiveServices.ContentModerator.Models.DetectedLanguage> DetectLanguageAsync (this Microsoft.Azure.CognitiveServices.ContentModerator.ITextModeration operations, string textContentType, System.IO.Stream textContent, System.Threading.CancellationToken cancellationToken = default);
static member DetectLanguageAsync : Microsoft.Azure.CognitiveServices.ContentModerator.ITextModeration * string * System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.CognitiveServices.ContentModerator.Models.DetectedLanguage>
<Extension()>
Public Function DetectLanguageAsync (operations As ITextModeration, textContentType As String, textContent As Stream, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DetectedLanguage)

Parameters

operations
ITextModeration

The operations group for this extension method.

textContentType
System.String

The content type. Possible values include: 'text/plain', 'text/html', 'text/xml', 'text/markdown'

textContent
System.IO.Stream

Content to screen.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<DetectedLanguage>

Applies to