mirror of
https://github.com/houbb/sensitive-word.git
synced 2026-03-22 08:27:36 +08:00
release branch 0.0.3
This commit is contained in:
18
README.md
18
README.md
@@ -40,7 +40,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.houbb</groupId>
|
<groupId>com.github.houbb</groupId>
|
||||||
<artifactId>sensitive-word</artifactId>
|
<artifactId>sensitive-word</artifactId>
|
||||||
<version>0.0.2</version>
|
<version>0.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -73,3 +73,19 @@ final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天
|
|||||||
List<String> wordList = SensitiveWordBs.getInstance().findAll(text);
|
List<String> wordList = SensitiveWordBs.getInstance().findAll(text);
|
||||||
Assert.assertEquals("[五星红旗, 毛主席, 天安门]", wordList.toString());
|
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);
|
||||||
|
```
|
||||||
@@ -22,4 +22,10 @@
|
|||||||
| 1 | O | 优化最大长度匹配模式 | 2020-1-8 09:34:35 | |
|
| 1 | O | 优化最大长度匹配模式 | 2020-1-8 09:34:35 | |
|
||||||
| 2 | A | 新增替换实现 | 2020-1-8 09:34:35 | 性能优于各种博客的直接正则替换。|
|
| 2 | A | 新增替换实现 | 2020-1-8 09:34:35 | 性能优于各种博客的直接正则替换。|
|
||||||
| 3 | O | 优化公共代码到 heaven 项目 | 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 | |
|
| 4 | O | 初步优化 DFA 对应 map 的大小 | 2020-1-8 09:34:35 | |
|
||||||
|
|
||||||
|
# release_0.0.3
|
||||||
|
|
||||||
|
| 序号 | 变更类型 | 说明 | 时间 | 备注 |
|
||||||
|
|:---|:---|:---|:---|:--|
|
||||||
|
| 1 | O | 优化敏感词大小 | 2020-1-8 09:34:35 | |
|
||||||
7
pom.xml
7
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.houbb</groupId>
|
<groupId>com.github.houbb</groupId>
|
||||||
<artifactId>sensitive-word</artifactId>
|
<artifactId>sensitive-word</artifactId>
|
||||||
<version>0.0.3-SNAPSHOT</version>
|
<version>0.0.3</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!--============================== All Plugins START ==============================-->
|
<!--============================== All Plugins START ==============================-->
|
||||||
@@ -25,7 +25,8 @@
|
|||||||
<project.compiler.level>1.7</project.compiler.level>
|
<project.compiler.level>1.7</project.compiler.level>
|
||||||
|
|
||||||
<!--============================== INTER ==============================-->
|
<!--============================== INTER ==============================-->
|
||||||
<heaven.version>0.1.68-SNAPSHOT</heaven.version>
|
<heaven.version>0.1.68</heaven.version>
|
||||||
|
<opencc4j.version>1.2.0</opencc4j.version>
|
||||||
<!--============================== OTHER ==============================-->
|
<!--============================== OTHER ==============================-->
|
||||||
<junit.version>4.12</junit.version>
|
<junit.version>4.12</junit.version>
|
||||||
</properties>
|
</properties>
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.houbb</groupId>
|
<groupId>com.github.houbb</groupId>
|
||||||
<artifactId>opencc4j</artifactId>
|
<artifactId>opencc4j</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>${opencc4j.version}</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
|
|||||||
@@ -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
|
SET groupName=com.github.houbb
|
||||||
:::: 项目名称
|
:::: 项目名称
|
||||||
|
|||||||
@@ -23,6 +23,6 @@ public final class AppConst {
|
|||||||
* 字典的大小
|
* 字典的大小
|
||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
*/
|
*/
|
||||||
public static final int DICT_SIZE = 183836;
|
public static final int DICT_SIZE = 66337;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -16,6 +16,7 @@ import java.util.List;
|
|||||||
* @author binbin.hou
|
* @author binbin.hou
|
||||||
* @since 0.0.1
|
* @since 0.0.1
|
||||||
*/
|
*/
|
||||||
|
@Ignore
|
||||||
public class DataInitTest {
|
public class DataInitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import java.util.List;
|
|||||||
* @author binbin.hou
|
* @author binbin.hou
|
||||||
* @since 0.0.3
|
* @since 0.0.3
|
||||||
*/
|
*/
|
||||||
|
@Ignore
|
||||||
public class DictSlimTest {
|
public class DictSlimTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import java.util.List;
|
|||||||
* @author binbin.hou
|
* @author binbin.hou
|
||||||
* @since 0.0.3
|
* @since 0.0.3
|
||||||
*/
|
*/
|
||||||
|
@Ignore
|
||||||
public class StopWordTest {
|
public class StopWordTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user