release branch 0.19.1

This commit is contained in:
binbin.hou
2024-08-28 10:08:54 +08:00
parent eaeba10e13
commit cf80e0b422
6 changed files with 32 additions and 4 deletions

View File

@@ -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 |

View File

@@ -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>
```

View File

@@ -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 ==============================-->

View File

@@ -10,7 +10,7 @@ ECHO "============================= RELEASE START..."
:: 版本号信息(需要手动指定)
:::: 旧版本名称
SET version=0.19.0
SET version=0.19.1
:::: 新版本名称
SET newVersion=0.20.0
:::: 组织名称

View File

@@ -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;

View File

@@ -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());
}
}