pub struct WuManber { /* private fields */ }
Expand description
Re-export for backward compatibility High-performance Wu-Manber multi-pattern matching algorithm Optimized for Chinese text processing with parallel table building and memory efficiency
Implementations§
Source§impl WuManber
impl WuManber
Sourcepub fn new_chinese(patterns: Vec<String>) -> Self
pub fn new_chinese(patterns: Vec<String>) -> Self
Create new instance optimized for Chinese characters
Sourcepub fn new(patterns: Vec<String>, block_size: usize) -> Self
pub fn new(patterns: Vec<String>, block_size: usize) -> Self
Create new instance with custom block size
Sourcepub fn new_parallel(patterns: Vec<String>, block_size: usize) -> Self
pub fn new_parallel(patterns: Vec<String>, block_size: usize) -> Self
Create new instance with parallel table building
Sourcepub fn new_with_space_handling(
patterns: Vec<String>,
space_handling: SpaceHandling,
) -> Self
pub fn new_with_space_handling( patterns: Vec<String>, space_handling: SpaceHandling, ) -> Self
Create new instance with space handling strategy
Sourcepub fn new_with_block_size_and_space_handling(
patterns: Vec<String>,
block_size: usize,
space_handling: SpaceHandling,
) -> Self
pub fn new_with_block_size_and_space_handling( patterns: Vec<String>, block_size: usize, space_handling: SpaceHandling, ) -> Self
Create new instance with custom block size and space handling
Sourcepub fn new_parallel_with_space_handling(
patterns: Vec<String>,
block_size: usize,
space_handling: SpaceHandling,
) -> Self
pub fn new_parallel_with_space_handling( patterns: Vec<String>, block_size: usize, space_handling: SpaceHandling, ) -> Self
Create new instance with parallel table building and space handling
Sourcepub fn search(&self, text: &str) -> Option<Arc<String>>
pub fn search(&self, text: &str) -> Option<Arc<String>>
Search for first match using Wu-Manber algorithm with space handling
Sourcepub fn search_string(&self, text: &str) -> Option<String>
pub fn search_string(&self, text: &str) -> Option<String>
Legacy search method for string compatibility
Sourcepub fn search_all(&self, text: &str) -> Vec<Arc<String>>
pub fn search_all(&self, text: &str) -> Vec<Arc<String>>
Find all matches in text with space handling
Sourcepub fn search_all_strings(&self, text: &str) -> Vec<String>
pub fn search_all_strings(&self, text: &str) -> Vec<String>
Find all matches returning strings for compatibility
Sourcepub fn replace_all(&self, text: &str, replacement: char) -> String
pub fn replace_all(&self, text: &str, replacement: char) -> String
Replace all matches with replacement character
Sourcepub fn remove_all(&self, text: &str) -> String
pub fn remove_all(&self, text: &str) -> String
Remove all matches from text
Sourcepub fn find_matches(&self, text: &str) -> Vec<Match>
pub fn find_matches(&self, text: &str) -> Vec<Match>
Find all match positions with byte offsets
Sourcepub fn patterns_strings(&self) -> Vec<String>
pub fn patterns_strings(&self) -> Vec<String>
Get original patterns as strings
Sourcepub fn contains_pattern(&self, pattern: &str) -> bool
pub fn contains_pattern(&self, pattern: &str) -> bool
Check if pattern exists (使用 pattern_set 提供 O(1) 查找)
Sourcepub fn space_handling(&self) -> SpaceHandling
pub fn space_handling(&self) -> SpaceHandling
Get space handling strategy
Sourcepub fn memory_stats(&self) -> WuManberMemoryStats
pub fn memory_stats(&self) -> WuManberMemoryStats
Get memory usage statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WuManber
impl RefUnwindSafe for WuManber
impl Send for WuManber
impl Sync for WuManber
impl Unpin for WuManber
impl UnwindSafe for WuManber
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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