1 unstable release
0.1.0 | Dec 4, 2022 |
---|
#1851 in Text processing
120KB
6.5K
SLoC
stfu - Shut The Ferris Up
A Rust library for profanity filtering.
Usage
use stfu::
lib.rs
:
stfu: Shut The Ferris Up
A general word filter for whatever use you want.
Usage
use stfu::types::OwnedFilter;
use stfu::word_lists::category::SEXUAL_ANATOMY_SEXUAL_ACTS;
let mut filter = OwnedFilter::default();
filter.add_slice(&SEXUAL_ANATOMY_SEXUAL_ACTS);
assert_eq!(filter.filter_string("hello world"), None);
assert_eq!(filter.filter_string("Mary had a little fucking lamb"), Some("fucking"));
use stfu::word_lists::category::SEXUAL_ANATOMY_SEXUAL_ACTS;
use stfu::filter::filter_string;
assert_eq!(filter_string("hello world", &SEXUAL_ANATOMY_SEXUAL_ACTS), None);
assert_eq!(filter_string("Mary had a little fucking lamb", &SEXUAL_ANATOMY_SEXUAL_ACTS), Some("fucking"));