π« rust-sensitive
Sensitive word filtering, support multiple data source loading, multiple filtering algorithms, multiple operation functions
π Feature
- Supports a wide range of operating functions
filter()
returns the filtered text.replace()
Returns the text after replacing sensitive words.is_sensitive()
Returns whether the text contains sensitive words.find_one()
Returns the first sensitive word matched.find_all()
returns all the sensitive words matched.
- Support multiple data sources loading
- β Support memory storage
- π² Support mysql storage
- π² Support mongo storage
- Support multiple filtering algorithms
- β
DFA Use
HashMap
to match sensitive words. - β AC automated machine
- β
DFA Use
β Usage
first use
use DfaSensitiveWordMap;
filter()
replace()
replace // "hello" is sensitive word
is_sensitive()
find_one()
find_all()
find_all // "hello" "world" are sensitive words
β Get
Run the following Cargo command in your project directory:
cargo add rust_sensitive
Or add the following line to your Cargo.toml:
[dependencies]
rust_sensitive = "1.1.0"
π TODO
- add mongo data source support
- add bloom algorithm