跳到主要内容

sensitive_word

简介

敏感字符过滤(只支持了Trie树的敏感词过滤方式)

  • 如需要使用敏感词的正则过滤,请使用新版敏感词:ssword

组件接口

sensitive_word.gs

函数原型函数作用
bool has_any_match(string content)有没有敏感字符
string dfa_filter(string content, string placeholder = "*")过滤敏感词,dfa过滤
bool load_whitelist(array words, bool reset = false)载入白名单
bool load_from_url(string url, bool reset = false)从url加载敏感字符
bool load_from_file(string path, bool reset = false)从文件里加载敏感字符
object new_one(string name, array words = nil)新建一个过滤器
object find_filter(string name)按名称查找过滤器