#[non_exhaustive]pub struct AnnotateTextResponse {
pub sentences: Vec<Sentence>,
pub entities: Vec<Entity>,
pub document_sentiment: Option<Sentiment>,
pub language_code: String,
pub categories: Vec<ClassificationCategory>,
pub moderation_categories: Vec<ClassificationCategory>,
pub language_supported: bool,
/* private fields */
}Expand description
The text annotations response message.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sentences: Vec<Sentence>Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.
entities: Vec<Entity>Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.AnnotateTextRequest.Features.extract_entity_sentiment].
document_sentiment: Option<Sentiment>The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.
language_code: StringThe language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][] field for more details.
categories: Vec<ClassificationCategory>Categories identified in the input document.
moderation_categories: Vec<ClassificationCategory>Harmful and sensitive categories identified in the input document.
language_supported: boolWhether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.
Implementations§
Source§impl AnnotateTextResponse
impl AnnotateTextResponse
pub fn new() -> Self
Sourcepub fn set_sentences<T, V>(self, v: T) -> Self
pub fn set_sentences<T, V>(self, v: T) -> Self
Sourcepub fn set_entities<T, V>(self, v: T) -> Self
pub fn set_entities<T, V>(self, v: T) -> Self
Sourcepub fn set_document_sentiment<T>(self, v: T) -> Self
pub fn set_document_sentiment<T>(self, v: T) -> Self
Sets the value of document_sentiment.
§Example
use google_cloud_language_v2::model::Sentiment;
let x = AnnotateTextResponse::new().set_document_sentiment(Sentiment::default()/* use setters */);Sourcepub fn set_or_clear_document_sentiment<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_document_sentiment<T>(self, v: Option<T>) -> Self
Sets or clears the value of document_sentiment.
§Example
use google_cloud_language_v2::model::Sentiment;
let x = AnnotateTextResponse::new().set_or_clear_document_sentiment(Some(Sentiment::default()/* use setters */));
let x = AnnotateTextResponse::new().set_or_clear_document_sentiment(None::<Sentiment>);Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
§Example
let x = AnnotateTextResponse::new().set_language_code("example");Sourcepub fn set_categories<T, V>(self, v: T) -> Self
pub fn set_categories<T, V>(self, v: T) -> Self
Sets the value of categories.
§Example
use google_cloud_language_v2::model::ClassificationCategory;
let x = AnnotateTextResponse::new()
.set_categories([
ClassificationCategory::default()/* use setters */,
ClassificationCategory::default()/* use (different) setters */,
]);Sourcepub fn set_moderation_categories<T, V>(self, v: T) -> Self
pub fn set_moderation_categories<T, V>(self, v: T) -> Self
Sets the value of moderation_categories.
§Example
use google_cloud_language_v2::model::ClassificationCategory;
let x = AnnotateTextResponse::new()
.set_moderation_categories([
ClassificationCategory::default()/* use setters */,
ClassificationCategory::default()/* use (different) setters */,
]);Sourcepub fn set_language_supported<T: Into<bool>>(self, v: T) -> Self
pub fn set_language_supported<T: Into<bool>>(self, v: T) -> Self
Sets the value of language_supported.
§Example
let x = AnnotateTextResponse::new().set_language_supported(true);Trait Implementations§
Source§impl Clone for AnnotateTextResponse
impl Clone for AnnotateTextResponse
Source§fn clone(&self) -> AnnotateTextResponse
fn clone(&self) -> AnnotateTextResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more