pub struct CoherenceDetector { /* private fields */ }Expand description
Coherence detector for conversation segments.
Implementations§
Source§impl CoherenceDetector
impl CoherenceDetector
Sourcepub fn new(threshold: f32) -> Self
pub fn new(threshold: f32) -> Self
Create a new coherence detector with default settings.
This is backward compatible - automatically loads preset patterns.
Sourcepub fn new_with_registry(threshold: f32, registry: PatternRegistry) -> Self
pub fn new_with_registry(threshold: f32, registry: PatternRegistry) -> Self
Create a coherence detector with a custom pattern registry.
Use this when you need to customize patterns or load from a file.
Sourcepub fn with_hardcode_config(self, config: HardcodeConfig) -> Self
pub fn with_hardcode_config(self, config: HardcodeConfig) -> Self
Create a coherence detector with custom hardcode config.
Sourcepub fn pattern_registry(&self) -> &PatternRegistry
pub fn pattern_registry(&self) -> &PatternRegistry
Get a reference to the pattern registry.
Sourcepub fn pattern_registry_mut(&mut self) -> &mut PatternRegistry
pub fn pattern_registry_mut(&mut self) -> &mut PatternRegistry
Get a mutable reference to the pattern registry.
Sourcepub fn should_keep_together(&self, messages: &[Message]) -> bool
pub fn should_keep_together(&self, messages: &[Message]) -> bool
Check if a group of messages should be kept together.
Sourcepub fn calculate_coherence(&self, messages: &[Message]) -> f32
pub fn calculate_coherence(&self, messages: &[Message]) -> f32
Calculate coherence score for a message group.
Sourcepub fn find_segmentation_points(&self, messages: &[Message]) -> Vec<usize>
pub fn find_segmentation_points(&self, messages: &[Message]) -> Vec<usize>
Find optimal segmentation points in messages.
Trait Implementations§
Source§impl Clone for CoherenceDetector
impl Clone for CoherenceDetector
Source§fn clone(&self) -> CoherenceDetector
fn clone(&self) -> CoherenceDetector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CoherenceDetector
impl Debug for CoherenceDetector
Auto Trait Implementations§
impl Freeze for CoherenceDetector
impl RefUnwindSafe for CoherenceDetector
impl Send for CoherenceDetector
impl Sync for CoherenceDetector
impl Unpin for CoherenceDetector
impl UnsafeUnpin for CoherenceDetector
impl UnwindSafe for CoherenceDetector
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