houbb / sensitive-word

👮‍♂️The sensitive word tool for java.(敏感词/违禁词/违法词/脏词。基于 DFA 算法实现的高性能 java 敏感词过滤工具框架。请勿发布涉及政治、广告、营销、翻墙、违反国家法律法规等内容。高性能敏感词检测过滤组件,附带繁体简体互换,支持全角半角互换,汉字转拼音,模糊搜索等功能。)
https://houbb.github.io/opensource/sensitive-word
Apache License 2.0
4.1k stars 545 forks source link

请问自定义deny词库有什么要求吗? #30

Closed grover572 closed 1 year ago

grover572 commented 1 year ago

请问自定义deny词库有什么要求吗?类似关键词长度之类的?因为我添加了一个“代课”的关键字没生效,然后用WordDenys.system()是生效的

houbb commented 1 year ago

没啥要求,可以看下例子。

大概率是用错了,比如指定了配置,要用指定后的引导类方法。

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: Saturn @.> 发送时间: 2023年4月29日 17:14 收件人: houbb/sensitive-word @.> 抄送: Subscribed @.***> 主题: Re: [houbb/sensitive-word] 请问自定义deny词库有什么要求吗? (Issue #30)

请问自定义deny词库有什么要求吗?类似关键词长度之类的?因为我添加了一个“代课”的关键字没生效,然后用WordDenys.system()是生效的

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

grover572 commented 1 year ago

找到原因了~ 我是用Spring注入的SensitiveWordBs,但是使用的时候用了SensitiveWordHelper,导致又在SensitiveWordHelper中new了WORD_BS

感谢houbb