敏感词工具类SensitiveUtil支持自定义字符过滤规则

This commit is contained in:
neko 2020-09-26 23:51:26 +08:00 committed by GitHub
parent f1ea1da90f
commit bc5028d6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,6 +84,15 @@ public final class SensitiveUtil {
}
}
/**
* 是否包含敏感词
* @param text 文本
* @return 是否包含
*/
public static boolean containsSensitive(String text){
return sensitiveTree.isMatch(text);
}
/**
* 是否包含敏感词
* @param obj bean会被转为JSON字符串