Skip to content

咨询下白名单问题 #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
luolei100 opened this issue Sep 2, 2024 · 2 comments
Closed

咨询下白名单问题 #76

luolei100 opened this issue Sep 2, 2024 · 2 comments

Comments

@luolei100
Copy link

image

这种情况如何让白名单“三黄片”生效。


SensitiveWordBs init = SensitiveWordBs.newInstance()
                .wordAllow(WordAllows.chains(WordAllows.defaults(),
                        () -> Lists.newArrayList("三黄片")))
                .wordDeny(WordDenys.chains(WordDenys.defaults()))
                .ignoreRepeat(true)
                .ignoreChineseStyle(true).init();
        init.addWord();

        System.out.println(init.replace("三黄片"));

com.github.houbb.sensitive.word.bs.SensitiveWordBs#addWord(java.util.Collection<java.lang.String>)

然后如何动态添加白名单词组, 或者我控制台新增的白名单词组如何生效?

@houbb
Copy link
Owner

houbb commented Sep 18, 2024

优先匹配到了【黄片】,目前的白名单设计的只影响到了最初的字典初始化,感觉是设计缺陷。我后续考虑优化一下。

@houbb houbb closed this as completed Sep 18, 2024
@houbb houbb reopened this Sep 18, 2024
@houbb
Copy link
Owner

houbb commented Sep 18, 2024

v0.21.0 已修正此问题,白名单较长,包含了黑名单的问题。

@houbb houbb closed this as completed Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants