Google Cloud Natural Language v1 API - Class LanguageService.LanguageServiceClient (3.4.0)

public class LanguageService.LanguageServiceClient : ClientBase<LanguageService.LanguageServiceClient>

Reference documentation and code samples for the Google Cloud Natural Language v1 API class LanguageService.LanguageServiceClient.

Client for LanguageService

Inheritance

object > ClientBase > ClientBaseLanguageServiceLanguageServiceClient > LanguageService.LanguageServiceClient

Namespace

Google.Cloud.Language.V1

Assembly

Google.Cloud.Language.V1.dll

Constructors

LanguageServiceClient()

protected LanguageServiceClient()

Protected parameterless constructor to allow creation of test doubles.

LanguageServiceClient(CallInvoker)

public LanguageServiceClient(CallInvoker callInvoker)

Creates a new client for LanguageService that uses a custom CallInvoker.

Parameter
NameDescription
callInvokerCallInvoker

The callInvoker to use to make remote calls.

LanguageServiceClient(ChannelBase)

public LanguageServiceClient(ChannelBase channel)

Creates a new client for LanguageService

Parameter
NameDescription
channelChannelBase

The channel to use to make remote calls.

LanguageServiceClient(ClientBaseConfiguration)

protected LanguageServiceClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration

The client configuration.

Methods

AnalyzeEntities(AnalyzeEntitiesRequest, CallOptions)

public virtual AnalyzeEntitiesResponse AnalyzeEntities(AnalyzeEntitiesRequest request, CallOptions options)

Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.

Parameters
NameDescription
requestAnalyzeEntitiesRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AnalyzeEntitiesResponse

The response received from the server.

AnalyzeEntities(AnalyzeEntitiesRequest, Metadata, DateTime?, CancellationToken)

public virtual AnalyzeEntitiesResponse AnalyzeEntities(AnalyzeEntitiesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.

Parameters
NameDescription
requestAnalyzeEntitiesRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AnalyzeEntitiesResponse

The response received from the server.

AnalyzeEntitiesAsync(AnalyzeEntitiesRequest, CallOptions)

public virtual AsyncUnaryCall<AnalyzeEntitiesResponse> AnalyzeEntitiesAsync(AnalyzeEntitiesRequest request, CallOptions options)

Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.

Parameters
NameDescription
requestAnalyzeEntitiesRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallAnalyzeEntitiesResponse

The call object.

AnalyzeEntitiesAsync(AnalyzeEntitiesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<AnalyzeEntitiesResponse> AnalyzeEntitiesAsync(AnalyzeEntitiesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.

Parameters
NameDescription
requestAnalyzeEntitiesRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallAnalyzeEntitiesResponse

The call object.

AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest, CallOptions)

public virtual AnalyzeEntitySentimentResponse AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest request, CallOptions options)

Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes sentiment associated with each entity and its mentions.

Parameters
NameDescription
requestAnalyzeEntitySentimentRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AnalyzeEntitySentimentResponse

The response received from the server.

AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest, Metadata, DateTime?, CancellationToken)

public virtual AnalyzeEntitySentimentResponse AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes sentiment associated with each entity and its mentions.

Parameters
NameDescription
requestAnalyzeEntitySentimentRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AnalyzeEntitySentimentResponse

The response received from the server.

AnalyzeEntitySentimentAsync(AnalyzeEntitySentimentRequest, CallOptions)

public virtual AsyncUnaryCall<AnalyzeEntitySentimentResponse> AnalyzeEntitySentimentAsync(AnalyzeEntitySentimentRequest request, CallOptions options)

Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes sentiment associated with each entity and its mentions.

Parameters
NameDescription
requestAnalyzeEntitySentimentRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallAnalyzeEntitySentimentResponse

The call object.

AnalyzeEntitySentimentAsync(AnalyzeEntitySentimentRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<AnalyzeEntitySentimentResponse> AnalyzeEntitySentimentAsync(AnalyzeEntitySentimentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes sentiment associated with each entity and its mentions.

Parameters
NameDescription
requestAnalyzeEntitySentimentRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallAnalyzeEntitySentimentResponse

The call object.

AnalyzeSentiment(AnalyzeSentimentRequest, CallOptions)

public virtual AnalyzeSentimentResponse AnalyzeSentiment(AnalyzeSentimentRequest request, CallOptions options)

Analyzes the sentiment of the provided text.

Parameters
NameDescription
requestAnalyzeSentimentRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AnalyzeSentimentResponse

The response received from the server.

AnalyzeSentiment(AnalyzeSentimentRequest, Metadata, DateTime?, CancellationToken)

public virtual AnalyzeSentimentResponse AnalyzeSentiment(AnalyzeSentimentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Analyzes the sentiment of the provided text.

Parameters
NameDescription
requestAnalyzeSentimentRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AnalyzeSentimentResponse

The response received from the server.

AnalyzeSentimentAsync(AnalyzeSentimentRequest, CallOptions)

public virtual AsyncUnaryCall<AnalyzeSentimentResponse> AnalyzeSentimentAsync(AnalyzeSentimentRequest request, CallOptions options)

Analyzes the sentiment of the provided text.

Parameters
NameDescription
requestAnalyzeSentimentRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallAnalyzeSentimentResponse

The call object.

AnalyzeSentimentAsync(AnalyzeSentimentRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<AnalyzeSentimentResponse> AnalyzeSentimentAsync(AnalyzeSentimentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Analyzes the sentiment of the provided text.

Parameters
NameDescription
requestAnalyzeSentimentRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallAnalyzeSentimentResponse

The call object.

AnalyzeSyntax(AnalyzeSyntaxRequest, CallOptions)

public virtual AnalyzeSyntaxResponse AnalyzeSyntax(AnalyzeSyntaxRequest request, CallOptions options)

Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.

Parameters
NameDescription
requestAnalyzeSyntaxRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AnalyzeSyntaxResponse

The response received from the server.

AnalyzeSyntax(AnalyzeSyntaxRequest, Metadata, DateTime?, CancellationToken)

public virtual AnalyzeSyntaxResponse AnalyzeSyntax(AnalyzeSyntaxRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.

Parameters
NameDescription
requestAnalyzeSyntaxRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AnalyzeSyntaxResponse

The response received from the server.

AnalyzeSyntaxAsync(AnalyzeSyntaxRequest, CallOptions)

public virtual AsyncUnaryCall<AnalyzeSyntaxResponse> AnalyzeSyntaxAsync(AnalyzeSyntaxRequest request, CallOptions options)

Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.

Parameters
NameDescription
requestAnalyzeSyntaxRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallAnalyzeSyntaxResponse

The call object.

AnalyzeSyntaxAsync(AnalyzeSyntaxRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<AnalyzeSyntaxResponse> AnalyzeSyntaxAsync(AnalyzeSyntaxRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.

Parameters
NameDescription
requestAnalyzeSyntaxRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallAnalyzeSyntaxResponse

The call object.

AnnotateText(AnnotateTextRequest, CallOptions)

public virtual AnnotateTextResponse AnnotateText(AnnotateTextRequest request, CallOptions options)

A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.

Parameters
NameDescription
requestAnnotateTextRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AnnotateTextResponse

The response received from the server.

AnnotateText(AnnotateTextRequest, Metadata, DateTime?, CancellationToken)

public virtual AnnotateTextResponse AnnotateText(AnnotateTextRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.

Parameters
NameDescription
requestAnnotateTextRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AnnotateTextResponse

The response received from the server.

AnnotateTextAsync(AnnotateTextRequest, CallOptions)

public virtual AsyncUnaryCall<AnnotateTextResponse> AnnotateTextAsync(AnnotateTextRequest request, CallOptions options)

A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.

Parameters
NameDescription
requestAnnotateTextRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallAnnotateTextResponse

The call object.

AnnotateTextAsync(AnnotateTextRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<AnnotateTextResponse> AnnotateTextAsync(AnnotateTextRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.

Parameters
NameDescription
requestAnnotateTextRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallAnnotateTextResponse

The call object.

ClassifyText(ClassifyTextRequest, CallOptions)

public virtual ClassifyTextResponse ClassifyText(ClassifyTextRequest request, CallOptions options)

Classifies a document into categories.

Parameters
NameDescription
requestClassifyTextRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
ClassifyTextResponse

The response received from the server.

ClassifyText(ClassifyTextRequest, Metadata, DateTime?, CancellationToken)

public virtual ClassifyTextResponse ClassifyText(ClassifyTextRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Classifies a document into categories.

Parameters
NameDescription
requestClassifyTextRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
ClassifyTextResponse

The response received from the server.

ClassifyTextAsync(ClassifyTextRequest, CallOptions)

public virtual AsyncUnaryCall<ClassifyTextResponse> ClassifyTextAsync(ClassifyTextRequest request, CallOptions options)

Classifies a document into categories.

Parameters
NameDescription
requestClassifyTextRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallClassifyTextResponse

The call object.

ClassifyTextAsync(ClassifyTextRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ClassifyTextResponse> ClassifyTextAsync(ClassifyTextRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Classifies a document into categories.

Parameters
NameDescription
requestClassifyTextRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallClassifyTextResponse

The call object.

ModerateText(ModerateTextRequest, CallOptions)

public virtual ModerateTextResponse ModerateText(ModerateTextRequest request, CallOptions options)

Moderates a document for harmful and sensitive categories.

Parameters
NameDescription
requestModerateTextRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
ModerateTextResponse

The response received from the server.

ModerateText(ModerateTextRequest, Metadata, DateTime?, CancellationToken)

public virtual ModerateTextResponse ModerateText(ModerateTextRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Moderates a document for harmful and sensitive categories.

Parameters
NameDescription
requestModerateTextRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
ModerateTextResponse

The response received from the server.

ModerateTextAsync(ModerateTextRequest, CallOptions)

public virtual AsyncUnaryCall<ModerateTextResponse> ModerateTextAsync(ModerateTextRequest request, CallOptions options)

Moderates a document for harmful and sensitive categories.

Parameters
NameDescription
requestModerateTextRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallModerateTextResponse

The call object.

ModerateTextAsync(ModerateTextRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ModerateTextResponse> ModerateTextAsync(ModerateTextRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Moderates a document for harmful and sensitive categories.

Parameters
NameDescription
requestModerateTextRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallModerateTextResponse

The call object.

NewInstance(ClientBaseConfiguration)

protected override LanguageService.LanguageServiceClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration
Returns
TypeDescription
LanguageServiceLanguageServiceClient
Overrides