pub struct TextAnalyzer { /* private fields */ }Expand description
Text analyzer
Implementations§
Source§impl TextAnalyzer
impl TextAnalyzer
Sourcepub fn analyze_stats(&self, text: &str) -> TextStats
pub fn analyze_stats(&self, text: &str) -> TextStats
Analyze text statistics
Sourcepub fn analyze_sentiment(&self, text: &str) -> SentimentResult
pub fn analyze_sentiment(&self, text: &str) -> SentimentResult
Perform sentiment analysis
Sourcepub fn extract_keywords(&self, text: &str, max_keywords: usize) -> KeywordResult
pub fn extract_keywords(&self, text: &str, max_keywords: usize) -> KeywordResult
Extract keywords from text
Sourcepub fn detect_language(&self, text: &str) -> LanguageResult
pub fn detect_language(&self, text: &str) -> LanguageResult
Detect language of text (simplified)
Source§impl TextAnalyzer
impl TextAnalyzer
Sourcepub fn extract_words(&self, text: &str) -> Vec<String>
pub fn extract_words(&self, text: &str) -> Vec<String>
Extract words from text
Sourcepub fn extract_sentences(&self, text: &str) -> Vec<String>
pub fn extract_sentences(&self, text: &str) -> Vec<String>
Extract sentences from text
Sourcepub fn extract_paragraphs(&self, text: &str) -> Vec<String>
pub fn extract_paragraphs(&self, text: &str) -> Vec<String>
Extract paragraphs from text
Sourcepub fn calculate_readability_score(
&self,
words: &[String],
sentences: &[String],
) -> f64
pub fn calculate_readability_score( &self, words: &[String], sentences: &[String], ) -> f64
Calculate readability score (simplified Flesch Reading Ease)
Sourcepub fn estimate_syllables(&self, words: &[String]) -> usize
pub fn estimate_syllables(&self, words: &[String]) -> usize
Estimate syllables in words (simplified)
Sourcepub fn calculate_word_frequencies(
&self,
words: &[String],
) -> HashMap<String, usize>
pub fn calculate_word_frequencies( &self, words: &[String], ) -> HashMap<String, usize>
Calculate word frequencies
Sourcepub fn calculate_language_scores(
&self,
words: &[String],
) -> HashMap<String, f64>
pub fn calculate_language_scores( &self, words: &[String], ) -> HashMap<String, f64>
Calculate language scores based on word patterns
Sourcepub fn default_stop_words() -> HashSet<String>
pub fn default_stop_words() -> HashSet<String>
Get default stop words
Sourcepub fn default_sentiment_words() -> SentimentWords
pub fn default_sentiment_words() -> SentimentWords
Get default sentiment word lists
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextAnalyzer
impl RefUnwindSafe for TextAnalyzer
impl Send for TextAnalyzer
impl Sync for TextAnalyzer
impl Unpin for TextAnalyzer
impl UnsafeUnpin for TextAnalyzer
impl UnwindSafe for TextAnalyzer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more