Closed JoshuaLiew closed 6 months ago
v0.13.0 已经支持。参见 wordResultCondition-针对匹配词进一步判断
如下:
final String text = "I have a nice day。";
List<String> wordList = SensitiveWordBs.newInstance()
.wordDeny(new IWordDeny() {
@Override
public List<String> deny() {
return Collections.singletonList("av");
}
})
.wordResultCondition(WordResultConditions.englishWordMatch())
.init()
.findAll(text);
Assert.assertEquals("[]", wordList.toString());
对于英文单词Disburse之类的,其中的sb字母会被替换,要怎么处理,能不能只有整个单词匹配的时候才替换