data_for_seo/entity/content_generation/text_summary.rs
1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3
4/// Result of `content_generation/text_summary/live`: structural and readability
5/// statistics for the target text.
6/// See <https://docs.dataforseo.com/v3/content_generation/text_summary/live/>.
7#[derive(Debug, Default, Serialize, Deserialize, Clone)]
8pub struct ContentGenerationApiTextSummary {
9 /// Number of sentences in the text.
10 pub sentences: Option<i64>,
11 /// Number of paragraphs in the text.
12 pub paragraphs: Option<i64>,
13 /// Number of words in the text.
14 pub words: Option<i64>,
15 /// Number of characters excluding spaces.
16 pub characters_without_spaces: Option<i64>,
17 /// Number of characters including spaces.
18 pub characters_with_spaces: Option<i64>,
19 /// Average number of words per sentence.
20 pub words_per_sentence: Option<f64>,
21 /// Average number of characters per word.
22 pub characters_per_word: Option<f64>,
23 /// Vocabulary density of the text.
24 pub vocabulary_density: Option<f64>,
25 /// Most common words mapped to their occurrence count.
26 pub keyword_density: Option<HashMap<String, i64>>,
27 /// Automated Readability Index.
28 pub automated_readability_index: Option<f64>,
29 /// Coleman–Liau Index.
30 pub coleman_liau_index: Option<f64>,
31 /// Flesch–Kincaid grade level.
32 pub flesch_kincaid_grade_level: Option<f64>,
33 /// SMOG readability index.
34 pub smog_readability_index: Option<f64>,
35 /// Number of spelling errors found.
36 pub spelling_errors: Option<i64>,
37 /// Number of grammar errors found.
38 pub grammar_errors: Option<i64>,
39}
40
41/// Result item of `content_generation/text_summary/languages`: a supported
42/// text-summary language.
43/// See <https://docs.dataforseo.com/v3/content_generation/text_summary/languages/>.
44#[derive(Debug, Default, Serialize, Deserialize, Clone)]
45pub struct ContentGenerationApiTextSummaryLanguage {
46 /// Full language name.
47 pub language_name: Option<String>,
48 /// ISO 639-1 language code.
49 pub language_code: Option<String>,
50}