sensitive-words-recognizer-new

Crates.iosensitive-words-recognizer-new
lib.rssensitive-words-recognizer-new
version0.3.0
sourcesrc
created_at2023-09-04 03:07:39.613303
updated_at2023-09-06 01:52:11.452699
descriptionA sensitive lexicon
homepage
repositoryhttps://github.com/victorteokw/sensitive-words-recognizer
max_upload_size
id962589
size12,662
Victor Teo (victorteokw)

documentation

README

sensitive-words-recognizer

This is a sensitive word crate.

The Features:

  • replace_sensitive_word()
fn filter_sensitive_words() {
    let str_vec = vec![
        "花呗信用卡代还OK套现",
        "套花呗分期代付",
        "马上套现信用卡",
        "期货套利",
        "空手套白狼",
        "守信用卡脖子",
        "坚定信心,同舟共济,科学防治,精准施策",
        "D+1还是T+1秒到结算免结算费",
        "Fuck you!",
        "Son of Bitch",
    ];

    println!("replace_sensitive_word......");
    for str in &str_vec {
        let replace_str = replace_sensitive_word(str, &MatchType::MinMatchType, '*');

        println!("{} --> {}", str, replace_str);
    }
}
Commit count: 8

cargo fmt