sensitive_word
简介
敏感字符过滤(只支持了Trie树的敏感词过滤方式)
- 如需要使用敏感词的正则过滤,请使用新版敏感词:ssword
组件接口
SensitiveWordFilter.gs
提供敏感字符过滤功能的对象
函数原型 | 函数作用 |
---|---|
bool load(array words, bool reset = false) | 加载敏感词列表 |
bool load_whitelist(array words, bool reset = false) | 载入白名单列表 |
bool has_any_match(string content) | 检查内容中是否包含敏感词 |
string dfa_filter(string content, string placeholder = "*") | 内容过滤,敏感词替换成'*' |
SensitiveWordWhitelist.gs
函数原型 | 函数作用 |
---|---|
bool load(array words, bool reset = false) | 加载白名单列表 |