diff --git a/CHANGE_LOG.md b/CHANGE_LOG.md
index 15f6fd0..d6b2969 100644
--- a/CHANGE_LOG.md
+++ b/CHANGE_LOG.md
@@ -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 |
diff --git a/README.md b/README.md
index 7fa190f..de96a5e 100644
--- a/README.md
+++ b/README.md
@@ -59,6 +59,10 @@
- 针对单个词的新增/删除,无需全量初始化
- 新增 allow/deny 空实现
+### V0.19.1
+
+- 修正 englishWordMatch #69 单个英文字符命中错误问题
+
## 更多资料
### 敏感词控台
@@ -89,7 +93,7 @@
com.github.houbb
sensitive-word
- 0.19.0
+ 0.19.1
```
diff --git a/pom.xml b/pom.xml
index 3a2432b..fbb1159 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.github.houbb
sensitive-word
- 0.19.0
+ 0.19.1
diff --git a/release.bat b/release.bat
index e50ee6b..72e117f 100644
--- a/release.bat
+++ b/release.bat
@@ -10,7 +10,7 @@ ECHO "============================= RELEASE START..."
:: 版本号信息(需要手动指定)
:::: 旧版本名称
-SET version=0.19.0
+SET version=0.19.1
:::: 新版本名称
SET newVersion=0.20.0
:::: 组织名称
diff --git a/src/main/java/com/github/houbb/sensitive/word/support/resultcondition/WordResultConditionEnglishWordMatch.java b/src/main/java/com/github/houbb/sensitive/word/support/resultcondition/WordResultConditionEnglishWordMatch.java
index 9e5f4d8..d0f2d71 100644
--- a/src/main/java/com/github/houbb/sensitive/word/support/resultcondition/WordResultConditionEnglishWordMatch.java
+++ b/src/main/java/com/github/houbb/sensitive/word/support/resultcondition/WordResultConditionEnglishWordMatch.java
@@ -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;
diff --git a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsResultConditionTest.java b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsResultConditionTest.java
index deddf98..f1d9f8e 100644
--- a/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsResultConditionTest.java
+++ b/src/test/java/com/github/houbb/sensitive/word/bs/SensitiveWordBsResultConditionTest.java
@@ -120,4 +120,21 @@ public class SensitiveWordBsResultConditionTest {
Assert.assertEquals("[]", wordList.toString());
}
+ @Test
+ public void englishWordMatchTest6() {
+ final String text = "cp cpm";
+
+ List wordList = SensitiveWordBs.newInstance()
+ .wordDeny(new IWordDeny() {
+ @Override
+ public List deny() {
+ return Arrays.asList("cp");
+ }
+ })
+ .wordResultCondition(WordResultConditions.englishWordMatch())
+ .init()
+ .findAll(text);
+ Assert.assertEquals("[cp]", wordList.toString());
+ }
+
}