From d891c500490f853a03a562de49bdc1835a76aae8 Mon Sep 17 00:00:00 2001 From: houbb Date: Sat, 1 Jun 2024 15:57:47 +0800 Subject: [PATCH] release branch 0.14.1 --- CHANGE_LOG.md | 8 +++ README.md | 56 ++++++++++--------- pom.xml | 2 +- release.bat | 2 +- .../sensitive/word/bs/SensitiveWordBs.java | 6 +- .../word/core/SensitiveWordHelper.java | 6 +- src/main/resources/dict.txt | 35 ------------ .../word/bs/SensitiveWordBsEmailTest.java | 12 +++- .../word/bs/SensitiveWordBsNumLenTest.java | 5 +- .../word/bs/SensitiveWordBsNumTest.java | 8 ++- .../word/bs/SensitiveWordBsUrlTest.java | 15 ++--- .../data/DictRemoveCommonITUsageTest.java | 46 +++++++++++++++ .../handler/WordResultHandlerTest.java | 5 +- 13 files changed, 125 insertions(+), 81 deletions(-) create mode 100644 src/test/java/com/github/houbb/sensitive/word/data/DictRemoveCommonITUsageTest.java diff --git a/CHANGE_LOG.md b/CHANGE_LOG.md index f989f24..6e293d8 100644 --- a/CHANGE_LOG.md +++ b/CHANGE_LOG.md @@ -292,3 +292,11 @@ | 序号 | 变更类型 | 说明 | 时间 | 备注 | |:---|:-----|------------|:-------------------|:-------------------------------------------------| | 1 | A | 结果添加敏感词的类别 | 2024-4-11 15:02:25 | | + +# release_0.14.1 + +| 序号 | 变更类型 | 说明 | 时间 | 备注 | +|:---|:-----|------------------------------------------------------------------------------------------|:------------------|:------| +| 1 | O | 敏感词优化移除: 译码器/鞋帽/破解/看下/快乐水/冷却/招聘/搬迁/机票/谣言/第4代/赚钱/1989年/贫穷/护士/工作人员/网通/超速/明心/人民/服务管理/刺激/心水/ | 2024-6-01 15:02:25 | | +| 2 | O | 敏感词优化移除: 影院/公关/韦小宝/挣钱/资本主义/人也/战争/水浒/女装/装修/妹妹/他爸爸/他妈妈 | 2024-6-01 15:02:25 | | +| 3 | O | 默认关闭数字+网址+邮箱的校验 | 2024-6-01 15:02:25 | 降低误判率 | diff --git a/README.md b/README.md index 56314a4..e6198b0 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,10 @@ [CHANGE_LOG.md](https://github.com/houbb/sensitive-word/blob/master/CHANGE_LOG.md) -V0.14.0: raw 添加敏感词类别。 +V0.14.1: + +- 移除部分敏感词 +- 默认关闭 url/email/num 的校验 ## 更多资料 @@ -84,7 +87,7 @@ V0.14.0: raw 添加敏感词类别。 com.github.houbb sensitive-word - 0.14.0 + 0.14.1 ``` @@ -149,9 +152,11 @@ List wordList = SensitiveWordHelper.findAll(text, WordResultHandlers.wor WordResultHandlers.raw() 可以保留对应的下标信息、类别信息: ```java -final String text = "骂人:你他妈; 邮箱:123@qq.com; mobile: 13088889999; 网址:https://www.baidu.com"; -List wordList3 = SensitiveWordHelper.findAll(text, WordResultHandlers.raw()); -Assert.assertEquals("[WordResult{startIndex=3, endIndex=6, type='WORD'}, WordResult{startIndex=11, endIndex=21, type='EMAIL'}, WordResult{startIndex=31, endIndex=42, type='NUM'}, WordResult{startIndex=55, endIndex=68, type='URL'}]", wordList3.toString()); +final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。"; + +// 默认敏感词标签为空 +List wordList1 = SensitiveWordHelper.findAll(text, WordResultHandlers.wordTags()); +Assert.assertEquals("[WordTagsDto{word='五星红旗', tags=[]}, WordTagsDto{word='毛主席', tags=[]}, WordTagsDto{word='天安门', tags=[]}]", wordList1.toString()); ``` ### 默认的替换策略 @@ -310,7 +315,7 @@ Assert.assertEquals("fuck", word); ```java final String text = "这个是我的微信:9⓿二肆⁹₈③⑸⒋➃㈤㊄"; -List wordList = SensitiveWordHelper.findAll(text); +List wordList = SensitiveWordBs.newInstance().enableNumCheck(true).init().findAll(text); Assert.assertEquals("[9⓿二肆⁹₈③⑸⒋➃㈤㊄]", wordList.toString()); ``` @@ -350,8 +355,7 @@ Assert.assertEquals("[ⒻⒻⒻfⓤuⓤ⒰cⓒ⒦]", wordList.toString()); ```java final String text = "楼主好人,邮箱 sensitiveword@xx.com"; - -List wordList = SensitiveWordHelper.findAll(text); +List wordList = SensitiveWordBs.newInstance().enableEmailCheck(true).init().findAll(text); Assert.assertEquals("[sensitiveword@xx.com]", wordList.toString()); ``` @@ -365,14 +369,17 @@ V0.2.1 之后,支持通过 `numCheckLen(长度)` 自定义检测的长度。 final String text = "你懂得:12345678"; // 默认检测 8 位 -List wordList = SensitiveWordBs.newInstance().init().findAll(text); +List wordList = SensitiveWordBs.newInstance() +.enableNumCheck(true) +.init().findAll(text); Assert.assertEquals("[12345678]", wordList.toString()); // 指定数字的长度,避免误杀 List wordList2 = SensitiveWordBs.newInstance() - .numCheckLen(9) - .init() - .findAll(text); +.enableNumCheck(true) +.numCheckLen(9) +.init() +.findAll(text); Assert.assertEquals("[]", wordList2.toString()); ``` @@ -382,14 +389,13 @@ Assert.assertEquals("[]", wordList2.toString()); ```java final String text = "点击链接 www.baidu.com查看答案"; +final SensitiveWordBs sensitiveWordBs = SensitiveWordBs.newInstance().enableUrlCheck(true).init(); + + ' +List wordList = sensitiveWordBs.findAll(text); +Assert.assertEquals("[www.baidu.com]", wordList.toString()); -List wordList = SensitiveWordBs.newInstance().init().findAll(text); -Assert.assertEquals("[链接, www.baidu.com]", wordList.toString()); - -Assert.assertEquals("点击** *************查看答案", SensitiveWordBs - .newInstance() - .init() - .replace(text)); +Assert.assertEquals("点击链接 *************查看答案", sensitiveWordBs.replace(text)); ``` # 引导类特性配置 @@ -414,9 +420,9 @@ SensitiveWordBs wordBs = SensitiveWordBs.newInstance() .ignoreChineseStyle(true) .ignoreEnglishStyle(true) .ignoreRepeat(false) - .enableNumCheck(true) - .enableEmailCheck(true) - .enableUrlCheck(true) + .enableNumCheck(false) + .enableEmailCheck(false) + .enableUrlCheck(false) .enableWordCheck(true) .numCheckLen(8) .wordTag(WordTags.none()) @@ -439,9 +445,9 @@ Assert.assertTrue(wordBs.contains(text)); | 4 | ignoreChineseStyle | 忽略中文的书写格式 | true | | 5 | ignoreEnglishStyle | 忽略英文的书写格式 | true | | 6 | ignoreRepeat | 忽略重复词 | false | -| 7 | enableNumCheck | 是否启用数字检测。 | true | -| 8 | enableEmailCheck | 是有启用邮箱检测 | true | -| 9 | enableUrlCheck | 是否启用链接检测 | true | +| 7 | enableNumCheck | 是否启用数字检测。 | false | +| 8 | enableEmailCheck | 是有启用邮箱检测 | false | +| 9 | enableUrlCheck | 是否启用链接检测 | false | | 10 | enableWordCheck | 是否启用敏感单词检测 | true | | 11 | numCheckLen | 数字检测,自定义指定长度。 | 8 | | 12 | wordTag | 词对应的标签 | none | diff --git a/pom.xml b/pom.xml index f30901a..7507e64 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.houbb sensitive-word - 0.14.0 + 0.14.1 diff --git a/release.bat b/release.bat index 0b7323f..43a4377 100644 --- a/release.bat +++ b/release.bat @@ -10,7 +10,7 @@ ECHO "============================= RELEASE START..." :: 版本号信息(需要手动指定) :::: 旧版本名称 -SET version=0.14.0 +SET version=0.14.1 :::: 新版本名称 SET newVersion=0.15.0 :::: 组织名称 diff --git a/src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java b/src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java index 0cb702a..71c7254 100644 --- a/src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java +++ b/src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java @@ -74,15 +74,15 @@ public class SensitiveWordBs { /** * 启用数字检测 */ - private boolean enableNumCheck = true; + private boolean enableNumCheck = false; /** * 启用邮箱检测 */ - private boolean enableEmailCheck = true; + private boolean enableEmailCheck = false; /** * 启用 URL 检测 */ - private boolean enableUrlCheck = true; + private boolean enableUrlCheck = false; /** * 单词校验 diff --git a/src/main/java/com/github/houbb/sensitive/word/core/SensitiveWordHelper.java b/src/main/java/com/github/houbb/sensitive/word/core/SensitiveWordHelper.java index 26e2592..1223f05 100644 --- a/src/main/java/com/github/houbb/sensitive/word/core/SensitiveWordHelper.java +++ b/src/main/java/com/github/houbb/sensitive/word/core/SensitiveWordHelper.java @@ -23,7 +23,11 @@ public final class SensitiveWordHelper { * * @since 0.0.13 */ - private static final SensitiveWordBs WORD_BS = SensitiveWordBs.newInstance().init(); + private static final SensitiveWordBs WORD_BS = SensitiveWordBs.newInstance() + .enableNumCheck(false) + .enableEmailCheck(false) + .enableUrlCheck(false) + .init(); /** * 是否包含敏感词 diff --git a/src/main/resources/dict.txt b/src/main/resources/dict.txt index 5faf62e..d0c7697 100644 --- a/src/main/resources/dict.txt +++ b/src/main/resources/dict.txt @@ -166,7 +166,6 @@ 1969尼木 1989事件 1989天安门 -1989年 1989年6月4日 1992年5月13日 19dy淫色贴图 @@ -11630,7 +11629,6 @@ z以留吧以其以武 人个资料出售 人之初性本上 人之本性生活不就是为了钱和x -人也 人事任免 人事变动 人事布局出手既稳又重 @@ -11747,7 +11745,6 @@ z以留吧以其以武 人权调查 人欲 人死了以后再通知我们吧 -人民 人民不敢说话 人民之声 人民之声论坛 @@ -11905,7 +11902,6 @@ z以留吧以其以武 他娘的 他干 他母亲 -他爸爸 他爹 他祖宗 他英文名字charlesho加上出生年份1980 @@ -16428,7 +16424,6 @@ z以留吧以其以武 公仆真是笨蛋 公僿真是笨蛋 公公狂操儿媳妇小穴 -公关 公关删除 公关删除百度信息 公关删除论坛信息 @@ -17327,7 +17322,6 @@ z以留吧以其以武 冴木椋无码 冴木椋种子 冷兵器专卖 -冷却 冷妹妹2影院 冷妻难惹总裁请下堂 冷宽 @@ -20717,7 +20711,6 @@ z以留吧以其以武 刺刀直销qq 刺刀转让qq 刺刀销售 -刺激 刺激养眼图片 刺激邂逅 刻章 @@ -26333,7 +26326,6 @@ z以留吧以其以武 女职工张美霞 女良 女被人家搞 -女装 女记者被山西检察官 女领导男秘书 女领导男秘书txt @@ -26681,7 +26673,6 @@ z以留吧以其以武 妹可辣舞 妹喜欢直接点的男生 妹妞露穴 -妹妹 妹妹mm激情 妹妹上门 妹妹上门援交 @@ -28790,7 +28781,6 @@ z以留吧以其以武 工业黑索今出售 工产党 工产谠 -工作人员 工作肯定在法院 工作证 工信部从每个纳税人的口袋 @@ -30490,7 +30480,6 @@ z以留吧以其以武 彭钢 影子政府 影片 -影院 影音收发器 影音棒 影音盒 @@ -30602,7 +30591,6 @@ z以留吧以其以武 心为君留身为君守君愿来否畏新 心动约会app 心情很低落我知道这个虚拟的网络不可能有真实朋友 -心水 心目中的中国地图 心藏大恶 忍无可忍 @@ -30619,7 +30607,6 @@ z以留吧以其以武 快乐丸 快乐丸出售 快乐到死 -快乐水 快乐西游 快克 快到高潮时他哭了 @@ -32341,7 +32328,6 @@ z以留吧以其以武 戒色是空 或者你直接加我徽信 战乱的星系 -战争 战争正在向我们走来 战争行为 战刀 @@ -34562,7 +34548,6 @@ z以留吧以其以武 抢粮记 抢购 护卫团 -护士 护士24点 护士mm乱淫 护士嫩穴扒开嫩穴嫩穴 @@ -34846,7 +34831,6 @@ z以留吧以其以武 招小姐 招揽大批新疆人 招考黑幕 -招聘 招聘公主 招聘公关 招聘兼职发帖员 @@ -34924,7 +34908,6 @@ z以留吧以其以武 挡不住的风情 挡中央 挡坦克 -挣钱 挤乳汁 挤母奶 挥发型 @@ -36965,7 +36948,6 @@ z以留吧以其以武 搞皮叛 搞破鞋 搬家公司 -搬迁 搭讪诱奸 携美人生 摇其夫语猥亵事 @@ -38467,7 +38449,6 @@ z以留吧以其以武 明升娱乐城赌博 明娟以车震生活 明年米贵 -明心 明心网 明思网 明慧 @@ -39212,7 +39193,6 @@ z以留吧以其以武 服务器租用 服务天使 服务小姐 -服务管理 服饰配件 望月加奈 望月宁宁种子 @@ -39464,7 +39444,6 @@ z以留吧以其以武 机机歪歪 机枪 机甲武圣 -机票 机舱之头等服务 机舱之头等服务txt 机霸大 @@ -42489,7 +42468,6 @@ z以留吧以其以武 水泽由奈种子 水泽由里香种子 水泽真奈种子 -水浒 水浒q传 水浴法制tnt 水胶炸药专卖 @@ -48789,7 +48767,6 @@ z以留吧以其以武 看上去很直 看上去很直txt 看上就约 -看下 看中国 看了你的资料感觉我们可以聊得来加我吧相片有我联系方式 看免费a片 @@ -49267,7 +49244,6 @@ z以留吧以其以武 破瓜 破碎机 破网 -破解 破解器 破解银行卡密码程序 破鞋 @@ -50201,7 +50177,6 @@ z以留吧以其以武 第3党 第3次世界大战 第3道路党 -第4代 第4代领导 第4色 第4色导航 @@ -51214,7 +51189,6 @@ z以留吧以其以武 网赚队5 网路公祭 网路创世纪 -网通 网银卡 网页性游戏 网页游戏 @@ -54743,7 +54717,6 @@ z以留吧以其以武 袭近平 装b 装b靠 -装修 装备展示 装备演示 装屄 @@ -55976,7 +55949,6 @@ z以留吧以其以武 评毛大力催生 诈骗 诉讼集团 -译码器 试爱 试用特洛伊卧底软件 试看5元3分钟 @@ -56162,7 +56134,6 @@ z以留吧以其以武 谢长廷 谢雕易遍 谢非 -谣言 谤罪获刑 谭作人 谭作人案 @@ -56331,7 +56302,6 @@ z以留吧以其以武 贪淫 贪色夫人 贫乳 -贫穷 购买2踢脚 购买3棱刮刀 购买3棱尖刀 @@ -56642,7 +56612,6 @@ z以留吧以其以武 贾系 贾育台 资料泄 -资本主义 资格证 资格证书制作 资格证代考服务 @@ -56709,7 +56678,6 @@ z以留吧以其以武 赖昌星 赖达 赚0 -赚钱 赚钱资料 赛丸丁 赛丸丁供应 @@ -56922,7 +56890,6 @@ z以留吧以其以武 超虐高h 超越红墙 超越者联盟突破精英 -超速 超速性快感 超高压电警棍出售 越之极品色女 @@ -62010,7 +61977,6 @@ z以留吧以其以武 面瘫 面粉掺假 革命 -鞋帽 鞑子 鞭满 鞭炮专卖qq @@ -62025,7 +61991,6 @@ z以留吧以其以武 鞭神 鞭长莫及 韦国清 -韦小宝 韦小宝现代猎艳记 韦小宝现代猎艳记txt 韩东方 diff --git a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsEmailTest.java b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsEmailTest.java index dcac883..831be5b 100644 --- a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsEmailTest.java +++ b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsEmailTest.java @@ -22,7 +22,10 @@ public class SensitiveWordBsEmailTest { public void emailEnglishTest() { final String text = "楼主好人,邮箱 sensitiveword@xx.com"; - List wordList = SensitiveWordBs.newInstance().init().findAll(text); + List wordList = SensitiveWordBs.newInstance() + .enableEmailCheck(true) + .init() + .findAll(text); Assert.assertEquals("[sensitiveword@xx.com]", wordList.toString()); } @@ -34,8 +37,11 @@ public class SensitiveWordBsEmailTest { public void emailNumberTest() { final String text = "楼主好人,邮箱 123456789@xx.com"; - List wordList = SensitiveWordBs.newInstance().init().findAll(text); - Assert.assertEquals("[123456789, xx.com]", wordList.toString()); + List wordList = SensitiveWordBs.newInstance() + .enableEmailCheck(true) + .init() + .findAll(text); + Assert.assertEquals("[123456789@xx.com]", wordList.toString()); } @Test diff --git a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsNumLenTest.java b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsNumLenTest.java index 738591b..dc7f0d0 100644 --- a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsNumLenTest.java +++ b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsNumLenTest.java @@ -23,11 +23,14 @@ public class SensitiveWordBsNumLenTest { final String text = "你懂得:12345678"; // 默认检测 8 位 - List wordList = SensitiveWordBs.newInstance().init().findAll(text); + List wordList = SensitiveWordBs.newInstance() + .enableNumCheck(true) + .init().findAll(text); Assert.assertEquals("[12345678]", wordList.toString()); // 指定数字的长度,避免误杀 List wordList2 = SensitiveWordBs.newInstance() + .enableNumCheck(true) .numCheckLen(9) .init() .findAll(text); diff --git a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsNumTest.java b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsNumTest.java index e201119..e2d485b 100644 --- a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsNumTest.java +++ b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsNumTest.java @@ -22,7 +22,9 @@ public class SensitiveWordBsNumTest { public void findAllTest() { final String text = "这个是我的微信:9989123456"; - List wordList = SensitiveWordBs.newInstance().init().findAll(text); + List wordList = SensitiveWordBs.newInstance() + .enableNumCheck(true) + .init().findAll(text); Assert.assertEquals("[9989123456]", wordList.toString()); } @@ -34,7 +36,9 @@ public class SensitiveWordBsNumTest { public void ignoreNumStyleTest() { final String text = "这个是我的微信:9⓿二肆⁹₈③⑸⒋➃㈤㊄"; - List wordList = SensitiveWordBs.newInstance().init().findAll(text); + List wordList = SensitiveWordBs.newInstance() + .enableNumCheck(true) + .init().findAll(text); Assert.assertEquals("[9⓿二肆⁹₈③⑸⒋➃㈤㊄]", wordList.toString()); } diff --git a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsUrlTest.java b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsUrlTest.java index a590337..38aae98 100644 --- a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsUrlTest.java +++ b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsUrlTest.java @@ -22,13 +22,11 @@ public class SensitiveWordBsUrlTest { public void commonUrlTest() { final String text = "点击链接 www.baidu.com查看答案"; - List wordList = SensitiveWordBs.newInstance().init().findAll(text); + final SensitiveWordBs sensitiveWordBs = SensitiveWordBs.newInstance().enableUrlCheck(true).init(); + List wordList = sensitiveWordBs.findAll(text); Assert.assertEquals("[www.baidu.com]", wordList.toString()); - Assert.assertEquals("点击链接 *************查看答案", SensitiveWordBs - .newInstance() - .init() - .replace(text)); + Assert.assertEquals("点击链接 *************查看答案", sensitiveWordBs.replace(text)); } /** @@ -43,10 +41,13 @@ public class SensitiveWordBsUrlTest { public void imageUrlTest() { final String text = "双击查看大图 www.big-image.png查看"; - List wordList = SensitiveWordBs.newInstance().init().findAll(text); + final SensitiveWordBs sensitiveWordBs = SensitiveWordBs.newInstance() + .enableUrlCheck(true) + .init(); + List wordList = sensitiveWordBs.findAll(text); Assert.assertEquals("[www.big-image.png]", wordList.toString()); - Assert.assertEquals("双击查看大图 *****************查看", SensitiveWordBs.newInstance().init().replace(text)); + Assert.assertEquals("双击查看大图 *****************查看", sensitiveWordBs.replace(text)); } } diff --git a/src/test/java/com/github/houbb/sensitive/word/data/DictRemoveCommonITUsageTest.java b/src/test/java/com/github/houbb/sensitive/word/data/DictRemoveCommonITUsageTest.java new file mode 100644 index 0000000..e5b038c --- /dev/null +++ b/src/test/java/com/github/houbb/sensitive/word/data/DictRemoveCommonITUsageTest.java @@ -0,0 +1,46 @@ +package com.github.houbb.sensitive.word.data; + +import com.github.houbb.heaven.util.io.FileUtil; +import com.github.houbb.sensitive.word.bs.SensitiveWordBs; +import org.junit.Ignore; +import org.junit.Test; + +import java.io.File; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * 常用的 it 使用 + * + * @author binbin.hou + * @since 0.14.1 + */ +@Ignore +public class DictRemoveCommonITUsageTest { + + /** + * 统计自己的文章,移除常用的 it 用语等。降低误判率 + */ + @Test + @Ignore + public void removeSingleWord() { + final String dir = "D:\\github\\houbb.github.io\\_posts"; + + File[] files = new File(dir).listFiles(); + + // 默认策略 + SensitiveWordBs sensitiveWordBs = SensitiveWordBs.newInstance().init(); + + Set allWords = new HashSet<>(); + for(File file : files) { + String content = FileUtil.getFileContent(file); + + List words = sensitiveWordBs.findAll(content); + allWords.addAll(words); + } + + System.out.println(allWords); + } + +} diff --git a/src/test/java/com/github/houbb/sensitive/word/support/handler/WordResultHandlerTest.java b/src/test/java/com/github/houbb/sensitive/word/support/handler/WordResultHandlerTest.java index e9d146d..9525a4d 100644 --- a/src/test/java/com/github/houbb/sensitive/word/support/handler/WordResultHandlerTest.java +++ b/src/test/java/com/github/houbb/sensitive/word/support/handler/WordResultHandlerTest.java @@ -33,8 +33,9 @@ public class WordResultHandlerTest { @Test public void findAllWordTest2() { final String text = "骂人:你他妈; 邮箱:123@qq.com; mobile: 13088889999; 网址:https://www.baidu.com"; - List wordList3 = SensitiveWordHelper.findAll(text, WordResultHandlers.raw()); - Assert.assertEquals("[WordResult{startIndex=3, endIndex=6, type='WORD'}, WordResult{startIndex=11, endIndex=21, type='EMAIL'}, WordResult{startIndex=31, endIndex=42, type='NUM'}, WordResult{startIndex=55, endIndex=68, type='URL'}]", wordList3.toString()); + List wordList3 = SensitiveWordHelper + .findAll(text, WordResultHandlers.raw()); + Assert.assertEquals("[WordResult{startIndex=3, endIndex=6, type='WORD'}]", wordList3.toString()); } @Test