mirror of
https://github.com/houbb/sensitive-word.git
synced 2026-03-22 08:27:36 +08:00
release branch 0.19.1
This commit is contained in:
@@ -343,3 +343,9 @@
|
||||
|:---|:-----|------------------------|:-------------------|:-----|
|
||||
| 1 | A | 单个词的新增/删除 | 2024-8-28 15:02:25 | |
|
||||
| 2 | A | allow/deny 的空实现,便于测试场景 | 2024-8-28 15:02:25 | |
|
||||
|
||||
# release_0.19.1
|
||||
|
||||
| 序号 | 变更类型 | 说明 | 时间 | 备注 |
|
||||
|:---|:-----|-------------------------------|:-------------------|:---|
|
||||
| 1 | F | 修正 englishWordMatch 单个字符误判的问题 | 2024-8-28 15:02:25 | https://github.com/houbb/sensitive-word/issues/69 |
|
||||
|
||||
@@ -59,6 +59,10 @@
|
||||
- 针对单个词的新增/删除,无需全量初始化
|
||||
- 新增 allow/deny 空实现
|
||||
|
||||
### V0.19.1
|
||||
|
||||
- 修正 englishWordMatch #69 单个英文字符命中错误问题
|
||||
|
||||
## 更多资料
|
||||
|
||||
### 敏感词控台
|
||||
@@ -89,7 +93,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<artifactId>sensitive-word</artifactId>
|
||||
<version>0.19.0</version>
|
||||
<version>0.19.1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<artifactId>sensitive-word</artifactId>
|
||||
<version>0.19.0</version>
|
||||
<version>0.19.1</version>
|
||||
|
||||
<properties>
|
||||
<!--============================== All Plugins START ==============================-->
|
||||
|
||||
@@ -10,7 +10,7 @@ ECHO "============================= RELEASE START..."
|
||||
|
||||
:: 版本号信息(需要手动指定)
|
||||
:::: 旧版本名称
|
||||
SET version=0.19.0
|
||||
SET version=0.19.1
|
||||
:::: 新版本名称
|
||||
SET newVersion=0.20.0
|
||||
:::: 组织名称
|
||||
|
||||
@@ -28,7 +28,8 @@ public class WordResultConditionEnglishWordMatch extends AbstractWordResultCondi
|
||||
}
|
||||
|
||||
// 判断后一个字符是否为英文
|
||||
if(endIndex < text.length() - 1) {
|
||||
// v0.19.1 修正 cp cpm 单个字符错误命中问题
|
||||
if(endIndex < text.length()) {
|
||||
char afterC = text.charAt(endIndex);
|
||||
if(CharUtil.isEnglish(afterC)) {
|
||||
return false;
|
||||
|
||||
@@ -120,4 +120,21 @@ public class SensitiveWordBsResultConditionTest {
|
||||
Assert.assertEquals("[]", wordList.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void englishWordMatchTest6() {
|
||||
final String text = "cp cpm";
|
||||
|
||||
List<String> wordList = SensitiveWordBs.newInstance()
|
||||
.wordDeny(new IWordDeny() {
|
||||
@Override
|
||||
public List<String> deny() {
|
||||
return Arrays.asList("cp");
|
||||
}
|
||||
})
|
||||
.wordResultCondition(WordResultConditions.englishWordMatch())
|
||||
.init()
|
||||
.findAll(text);
|
||||
Assert.assertEquals("[cp]", wordList.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user