pub struct WordSet { /* private fields */ }Expand description
The words to censor, answering string in CENSOR_WORDSET for all of them at once.
better_profanity stores each word as a VaryingString and compares a string with every
word in turn. When every variant in CHARS_MAPPING is a single character, as in the
default mapping, a string equals a VaryingString exactly when it has one character per
position of the word and each character is one of the variants allowed at its position.
A word is therefore a sequence of character sets, and the words form a trie whose edges
are those sets. A character can lie in the sets of several edges (* stands for any
vowel), so a lookup follows every matching edge.
Implementations§
Source§impl WordSet
impl WordSet
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WordSet
impl RefUnwindSafe for WordSet
impl Send for WordSet
impl Sync for WordSet
impl Unpin for WordSet
impl UnsafeUnpin for WordSet
impl UnwindSafe for WordSet
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