release branch 0.0.3

This commit is contained in:
binbin.hou
2020-01-08 21:10:49 +08:00
parent f673cc32cf
commit 0f9d2bece6
9 changed files with 34 additions and 8 deletions

View File

@@ -40,7 +40,7 @@
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>
</dependency>
```
@@ -73,3 +73,19 @@ final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天
List<String> 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);
```

View File

@@ -23,3 +23,9 @@
| 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 | |
# release_0.0.3
| 序号 | 变更类型 | 说明 | 时间 | 备注 |
|:---|:---|:---|:---|:--|
| 1 | O | 优化敏感词大小 | 2020-1-8 09:34:35 | |

View File

@@ -6,7 +6,7 @@
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
<version>0.0.3-SNAPSHOT</version>
<version>0.0.3</version>
<properties>
<!--============================== All Plugins START ==============================-->
@@ -25,7 +25,8 @@
<project.compiler.level>1.7</project.compiler.level>
<!--============================== INTER ==============================-->
<heaven.version>0.1.68-SNAPSHOT</heaven.version>
<heaven.version>0.1.68</heaven.version>
<opencc4j.version>1.2.0</opencc4j.version>
<!--============================== OTHER ==============================-->
<junit.version>4.12</junit.version>
</properties>
@@ -44,7 +45,7 @@
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>opencc4j</artifactId>
<version>1.2.0</version>
<version>${opencc4j.version}</version>
<optional>true</optional>
<exclusions>
<exclusion>

View File

@@ -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
:::: 项目名称

View File

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

Binary file not shown.

View File

@@ -16,6 +16,7 @@ import java.util.List;
* @author binbin.hou
* @since 0.0.1
*/
@Ignore
public class DataInitTest {
@Test

View File

@@ -17,6 +17,7 @@ import java.util.List;
* @author binbin.hou
* @since 0.0.3
*/
@Ignore
public class DictSlimTest {
/**

View File

@@ -17,6 +17,7 @@ import java.util.List;
* @author binbin.hou
* @since 0.0.3
*/
@Ignore
public class StopWordTest {
/**