pub struct TopicExtractor { /* private fields */ }Expand description
Extract topics from text with configurable parameters
Implementations§
Source§impl TopicExtractor
impl TopicExtractor
pub fn new(max_topics: usize, min_word_length: usize) -> Self
Sourcepub fn extract_from_text(&self, text: &str) -> Vec<String>
pub fn extract_from_text(&self, text: &str) -> Vec<String>
Extract topics from a single text
Sourcepub fn extract_from_messages(
&self,
messages: &[Message],
recent_count: usize,
) -> Vec<String>
pub fn extract_from_messages( &self, messages: &[Message], recent_count: usize, ) -> Vec<String>
Extract topics from messages
Sourcepub fn is_stop_word(word: &str) -> bool
pub fn is_stop_word(word: &str) -> bool
Check if a word is a stop word
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TopicExtractor
impl RefUnwindSafe for TopicExtractor
impl Send for TopicExtractor
impl Sync for TopicExtractor
impl Unpin for TopicExtractor
impl UnsafeUnpin for TopicExtractor
impl UnwindSafe for TopicExtractor
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