pub struct AdaptiveCompressor { /* private fields */ }Expand description
Budget-based adaptive document compressor.
Implementations§
Source§impl AdaptiveCompressor
impl AdaptiveCompressor
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a compressor with the default stopword list.
The default list includes common English function words (ASCII) and
standalone Korean connective words (non-ASCII). For domain-specific
stopwords use Self::with_stopwords.
Sourcepub fn with_stopwords(stopwords: Vec<String>) -> Self
pub fn with_stopwords(stopwords: Vec<String>) -> Self
Creates a compressor with a fully custom stopword list.
Stopwords are partitioned at construction time:
- ASCII words → indexed into a single Aho-Corasick automaton (case-insensitive).
- Non-ASCII words → stored as plain strings for token-level matching.
Sourcepub fn has_stopwords(&self) -> bool
pub fn has_stopwords(&self) -> bool
Returns true when no stopwords are configured (both lists empty).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AdaptiveCompressor
impl RefUnwindSafe for AdaptiveCompressor
impl Send for AdaptiveCompressor
impl Sync for AdaptiveCompressor
impl Unpin for AdaptiveCompressor
impl UnsafeUnpin for AdaptiveCompressor
impl UnwindSafe for AdaptiveCompressor
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