From 0f9d2bece653d193296cffd940793674960de0d6 Mon Sep 17 00:00:00 2001 From: "binbin.hou" <1060732496@qq.com> Date: Wed, 8 Jan 2020 21:10:49 +0800 Subject: [PATCH] release branch 0.0.3 --- README.md | 18 +++++++++++++++++- doc/CHANGE_LOG.md | 8 +++++++- pom.xml | 7 ++++--- release.bat | 4 ++-- .../sensitive/word/constant/AppConst.java | 2 +- src/main/resources/dict.txt | Bin 1283563 -> 1283548 bytes .../sensitive/word/data/DataInitTest.java | 1 + .../sensitive/word/data/DictSlimTest.java | 1 + .../sensitive/word/data/StopWordTest.java | 1 + 9 files changed, 34 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d435551..cf61dad 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ com.github.houbb sensitive-word - 0.0.2 + 0.0.3 ``` @@ -73,3 +73,19 @@ final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天 List wordList = SensitiveWordBs.getInstance().findAll(text); Assert.assertEquals("[五星红旗, 毛主席, 天安门]", wordList.toString()); ``` + +### 默认的替换策略 + +```java +final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。"; +String result = SensitiveWordBs.getInstance().replace(text); +Assert.assertEquals("****迎风飘扬,***的画像屹立在***前。", result); +``` + +### 指定替换的内容 + +```java +final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。"; +String result = SensitiveWordBs.getInstance().replace(text, '0'); +Assert.assertEquals("0000迎风飘扬,000的画像屹立在000前。", result); +``` \ No newline at end of file diff --git a/doc/CHANGE_LOG.md b/doc/CHANGE_LOG.md index 0bd9ef4..182bab3 100644 --- a/doc/CHANGE_LOG.md +++ b/doc/CHANGE_LOG.md @@ -22,4 +22,10 @@ | 1 | O | 优化最大长度匹配模式 | 2020-1-8 09:34:35 | | | 2 | A | 新增替换实现 | 2020-1-8 09:34:35 | 性能优于各种博客的直接正则替换。| | 3 | O | 优化公共代码到 heaven 项目 | 2020-1-8 09:34:35 | 便于后期统一维护整理。| -| 4 | O | 初步优化 DFA 对应 map 的大小 | 2020-1-8 09:34:35 | | \ No newline at end of file +| 4 | O | 初步优化 DFA 对应 map 的大小 | 2020-1-8 09:34:35 | | + +# release_0.0.3 + +| 序号 | 变更类型 | 说明 | 时间 | 备注 | +|:---|:---|:---|:---|:--| +| 1 | O | 优化敏感词大小 | 2020-1-8 09:34:35 | | \ No newline at end of file diff --git a/pom.xml b/pom.xml index 16e21a2..813b53a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.houbb sensitive-word - 0.0.3-SNAPSHOT + 0.0.3 @@ -25,7 +25,8 @@ 1.7 - 0.1.68-SNAPSHOT + 0.1.68 + 1.2.0 4.12 @@ -44,7 +45,7 @@ com.github.houbb opencc4j - 1.2.0 + ${opencc4j.version} true diff --git a/release.bat b/release.bat index 7993033..2e67f14 100644 --- a/release.bat +++ b/release.bat @@ -10,9 +10,9 @@ ECHO "============================= RELEASE START..." :: 版本号信息(需要手动指定) :::: 旧版本名称 -SET version=0.0.2 +SET version=0.0.3 :::: 新版本名称 -SET newVersion=0.0.3 +SET newVersion=0.0.4 :::: 组织名称 SET groupName=com.github.houbb :::: 项目名称 diff --git a/src/main/java/com/github/houbb/sensitive/word/constant/AppConst.java b/src/main/java/com/github/houbb/sensitive/word/constant/AppConst.java index f041231..661aef4 100644 --- a/src/main/java/com/github/houbb/sensitive/word/constant/AppConst.java +++ b/src/main/java/com/github/houbb/sensitive/word/constant/AppConst.java @@ -23,6 +23,6 @@ public final class AppConst { * 字典的大小 * @since 0.0.1 */ - public static final int DICT_SIZE = 183836; + public static final int DICT_SIZE = 66337; } diff --git a/src/main/resources/dict.txt b/src/main/resources/dict.txt index 396261e20d1c430ddead5a47cfe6ac175c6cf1ce..d4c0c09c506ec679f0670a1e8c0713884d4ff2fd 100644 GIT binary patch delta 69 zcmV~$sS$uM006<^3I9)D=?QTjLlx1~f