readsight 1.0.2

Multilingual readability library — 86 languages, 17 formulas, TeX-based syllable counting via the Frank M. Liang algorithm.
Documentation
//! Aggregate text statistics.

use std::collections::BTreeMap;

/// Aggregate statistics produced by [`crate::text::TextAnalyzer::analyze`].
#[derive(Debug, Clone, PartialEq)]
pub struct TextStatistics {
    /// Number of letters.
    pub letter_count: i64,
    /// Number of words.
    pub word_count: i64,
    /// Number of sentences.
    pub sentence_count: i64,
    /// Total syllables across all words.
    pub syllable_count: i64,
    /// Number of words with more than 2 syllables.
    pub polysyllable_count: i64,
    /// Mean syllables per word.
    pub average_syllables_per_word: f64,
    /// Mean words per sentence.
    pub average_words_per_sentence: f64,
    /// Number of "long" words (per the LIX threshold).
    pub long_word_count: i64,
    /// Histogram: syllable count -> number of words (ascending keys).
    pub syllable_histogram: BTreeMap<i64, i64>,
}