敏感词为空极端情况处理
This commit is contained in:
parent
5eb76176ab
commit
63b84ee69d
@ -77,6 +77,11 @@ public class SensitiveWordsFilter implements Serializable {
|
||||
int step = 1;
|
||||
//计算此位置开始2个字符的hash
|
||||
int hash = sp.nextTwoCharHash(i);
|
||||
|
||||
//如果没有敏感词,则直接返回内容
|
||||
if (nodes.length == 0) {
|
||||
return sentence;
|
||||
}
|
||||
/*
|
||||
* 根据hash获取第一个节点,
|
||||
* 真正匹配的节点可能不是第一个,
|
||||
|
Loading…
x
Reference in New Issue
Block a user