pub struct StopwordSet { /* private fields */ }Expand description
A sorted set of stopwords supporting O(log n) lookup.
Construct once per process with StopwordSet::builtin and reuse across
segmentation calls.
Implementations§
Source§impl StopwordSet
impl StopwordSet
Sourcepub fn builtin() -> Self
pub fn builtin() -> Self
Load the built-in Thai stopword list (1 029 entries, PyThaiNLP Apache-2.0).
Sourcepub fn from_text(data: &str) -> Self
pub fn from_text(data: &str) -> Self
Build a StopwordSet from a newline-separated word list.
Lines beginning with # and blank lines are ignored.
BOM characters (\u{FEFF}) are stripped from every line.
The resulting set is sorted and deduplicated.
Auto Trait Implementations§
impl Freeze for StopwordSet
impl RefUnwindSafe for StopwordSet
impl Send for StopwordSet
impl Sync for StopwordSet
impl Unpin for StopwordSet
impl UnsafeUnpin for StopwordSet
impl UnwindSafe for StopwordSet
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