pub struct DocumentMethods<'a, C>where
C: 'a,{ /* private fields */ }Expand description
A builder providing access to all methods supported on document resources.
It is not used directly, but through the CloudNaturalLanguage hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_language1 as language1;
use language1::{CloudNaturalLanguage, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let connector = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_only()
.enable_http2()
.build();
let executor = hyper_util::rt::TokioExecutor::new();
let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
yup_oauth2::client::CustomHyperClientBuilder::from(
hyper_util::client::legacy::Client::builder(executor).build(connector),
),
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http2()
.build()
);
let mut hub = CloudNaturalLanguage::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `analyze_entities(...)`, `analyze_entity_sentiment(...)`, `analyze_sentiment(...)`, `analyze_syntax(...)`, `annotate_text(...)`, `classify_text(...)` and `moderate_text(...)`
// to build up your call.
let rb = hub.documents();Implementations§
Source§impl<'a, C> DocumentMethods<'a, C>
impl<'a, C> DocumentMethods<'a, C>
Sourcepub fn analyze_entities(
&self,
request: AnalyzeEntitiesRequest,
) -> DocumentAnalyzeEntityCall<'a, C>
pub fn analyze_entities( &self, request: AnalyzeEntitiesRequest, ) -> DocumentAnalyzeEntityCall<'a, C>
Create a builder to help you perform the following task:
Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.
§Arguments
request- No description provided.
Sourcepub fn analyze_entity_sentiment(
&self,
request: AnalyzeEntitySentimentRequest,
) -> DocumentAnalyzeEntitySentimentCall<'a, C>
pub fn analyze_entity_sentiment( &self, request: AnalyzeEntitySentimentRequest, ) -> DocumentAnalyzeEntitySentimentCall<'a, C>
Create a builder to help you perform the following task:
Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions.
§Arguments
request- No description provided.
Sourcepub fn analyze_sentiment(
&self,
request: AnalyzeSentimentRequest,
) -> DocumentAnalyzeSentimentCall<'a, C>
pub fn analyze_sentiment( &self, request: AnalyzeSentimentRequest, ) -> DocumentAnalyzeSentimentCall<'a, C>
Create a builder to help you perform the following task:
Analyzes the sentiment of the provided text.
§Arguments
request- No description provided.
Sourcepub fn analyze_syntax(
&self,
request: AnalyzeSyntaxRequest,
) -> DocumentAnalyzeSyntaxCall<'a, C>
pub fn analyze_syntax( &self, request: AnalyzeSyntaxRequest, ) -> DocumentAnalyzeSyntaxCall<'a, C>
Create a builder to help you perform the following task:
Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.
§Arguments
request- No description provided.
Sourcepub fn annotate_text(
&self,
request: AnnotateTextRequest,
) -> DocumentAnnotateTextCall<'a, C>
pub fn annotate_text( &self, request: AnnotateTextRequest, ) -> DocumentAnnotateTextCall<'a, C>
Create a builder to help you perform the following task:
A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.
§Arguments
request- No description provided.
Sourcepub fn classify_text(
&self,
request: ClassifyTextRequest,
) -> DocumentClassifyTextCall<'a, C>
pub fn classify_text( &self, request: ClassifyTextRequest, ) -> DocumentClassifyTextCall<'a, C>
Create a builder to help you perform the following task:
Classifies a document into categories.
§Arguments
request- No description provided.
Sourcepub fn moderate_text(
&self,
request: ModerateTextRequest,
) -> DocumentModerateTextCall<'a, C>
pub fn moderate_text( &self, request: ModerateTextRequest, ) -> DocumentModerateTextCall<'a, C>
Create a builder to help you perform the following task:
Moderates a document for harmful and sensitive categories.
§Arguments
request- No description provided.