release branch 0.15.0

This commit is contained in:
binbin.hou
2024-04-23 16:49:45 +08:00
parent a19a3ba0a1
commit fafb4e4151
15 changed files with 34 additions and 25 deletions

View File

@@ -292,3 +292,9 @@
| 序号 | 变更类型 | 说明 | 时间 | 备注 |
|:---|:-----|------------|:-------------------|:-------------------------------------------------|
| 1 | A | 结果添加敏感词的类别 | 2024-4-11 15:02:25 | |
# release_0.15.0
| 序号 | 变更类型 | 说明 | 时间 | 备注 |
|:---|:-----|---------------------|:-------------------|:-------------------------------------------------|
| 1 | F | 调整默认文件名称,避免和其他框架重合。 | 2024-4-23 21:02:25 | https://github.com/houbb/sensitive-word/issues/54 |

View File

@@ -52,7 +52,9 @@
[CHANGE_LOG.md](https://github.com/houbb/sensitive-word/blob/master/CHANGE_LOG.md)
V0.14.0: raw 添加敏感词类别。
V0.15.0:
- [x] 修复 [#54](https://github.com/houbb/sensitive-word/issues/54)
## 更多资料
@@ -84,7 +86,7 @@ V0.14.0: raw 添加敏感词类别。
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
<version>0.14.0</version>
<version>0.15.0</version>
</dependency>
```

View File

@@ -6,7 +6,7 @@
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
<version>0.14.0</version>
<version>0.15.0</version>
<properties>
<!--============================== All Plugins START ==============================-->

View File

@@ -10,9 +10,9 @@ ECHO "============================= RELEASE START..."
:: 版本号信息(需要手动指定)
:::: 旧版本名称
SET version=0.14.0
SET version=0.15.0
:::: 新版本名称
SET newVersion=0.15.0
SET newVersion=0.16.0
:::: 组织名称
SET groupName=com.github.houbb
:::: 项目名称

View File

@@ -25,8 +25,8 @@ public class WordDenySystem implements IWordDeny {
@Override
public List<String> deny() {
List<String> results = StreamUtil.readAllLines("/dict.txt");
results.addAll(StreamUtil.readAllLines("/dict_en.txt"));
List<String> results = StreamUtil.readAllLines("/sensitive_word_dict.txt");
results.addAll(StreamUtil.readAllLines("/sensitive_word_dict_en.txt"));
results.addAll(StreamUtil.readAllLines("/sensitive_word_deny.txt"));
return results;
}

View File

@@ -0,0 +1 @@
package ai.com.github.houbb.sensitive.word.utils;

View File

@@ -34,11 +34,11 @@ public class DataInitTest {
@Test
@Ignore
public void trimTest() {
final String source = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String source = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
List<String> lines = FileUtil.readAllLines(source);
List<String> trimLines = CollectionUtil.distinct(CollectionUtil.trimCollection(lines));
final String target = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String target = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
}
/**
@@ -75,7 +75,7 @@ public class DataInitTest {
@Test
@Ignore
public void dictAllInOneTest() {
final List<String> allLines = distinctLines("dict.txt");
final List<String> allLines = distinctLines("sensitive_word_dict.txt");
allLines.addAll(distinctLines("不正当竞争.txt"));
allLines.addAll(distinctLines("人名.txt"));
@@ -97,7 +97,7 @@ public class DataInitTest {
Collections.sort(disctinct);
final String target = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String target = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
FileUtil.write(target, disctinct);
}
@@ -105,7 +105,7 @@ public class DataInitTest {
@Test
@Ignore
public void oneWordTest() {
final String source = "D:\\_github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String source = "D:\\_github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
List<String> lines = FileUtil.readAllLines(source);
for(int i = 0; i < lines.size(); i++) {

View File

@@ -38,7 +38,7 @@ public class DataUtil {
@Test
@Ignore
public void singleCharTest() {
final String path = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String path = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
List<String> stringList = FileUtil.readAllLines(path);
for(String s : stringList) {

View File

@@ -26,8 +26,8 @@ public class DictNumTest {
@Test
@Ignore
public void formatTest() {
final String sourceFile = "D:\\_github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String targetFile = "D:\\_github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String sourceFile = "D:\\_github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
final String targetFile = "D:\\_github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
List<String> words = FileUtil.readAllLines(sourceFile);
// List<String> formats = CollectionUtil.toList(words, new IHandler<String, String>() {

View File

@@ -27,7 +27,7 @@ public class DictRemoveSingleTest {
@Ignore
public void removeSingleWord() {
final String sourceFile = "D:\\code\\github\\sensitive-word\\src\\test\\resources\\dict_20231117.txt";
final String targetFile = "D:\\code\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String targetFile = "D:\\code\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
List<String> words = FileUtil.readAllLines(sourceFile);

View File

@@ -17,7 +17,7 @@ import java.util.List;
public class DictRemoveTwoEnglishTest {
public static void main(String[] args) {
final String sourceFile = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String sourceFile = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
final String targetFile = "D:\\github\\sensitive-word\\src\\test\\resources\\dict_v20240407.txt";
List<String> words = FileUtil.readAllLines(sourceFile);

View File

@@ -33,8 +33,8 @@ public class DictSlimTest {
@Test
@Ignore
public void formatTest() {
final String sourceFile = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String targetFile = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String sourceFile = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
final String targetFile = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
List<String> words = FileUtil.readAllLines(sourceFile);
@@ -67,8 +67,8 @@ public class DictSlimTest {
@Test
@Ignore
public void removeTest() {
final String sourceFile = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String targetFile = "D:\\github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String sourceFile = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
final String targetFile = "D:\\github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
List<String> words = FileUtil.readAllLines(sourceFile);
@@ -92,8 +92,8 @@ public class DictSlimTest {
*/
@Test
public void removeNumberMappingTest() {
final String sourceFile = "D:\\_github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String targetFile = "D:\\_github\\sensitive-word\\src\\main\\resources\\dict.txt";
final String sourceFile = "D:\\_github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
final String targetFile = "D:\\_github\\sensitive-word\\src\\main\\resources\\sensitive_word_dict.txt";
List<String> words = FileUtil.readAllLines(sourceFile);
List<String> formats = CollectionUtil.toList(words, new IHandler<String, String>() {

View File

@@ -22,7 +22,7 @@ public class DataMemoryTest {
*/
@Test
public void hashMapTest() {
List<String> allLines = StreamUtil.readAllLines("/dict.txt");
List<String> allLines = StreamUtil.readAllLines("/sensitive_word_dict.txt");
IWordData wordData = WordDatas.defaults();
wordData.initWordData(allLines);
@@ -36,7 +36,7 @@ public class DataMemoryTest {
//33.4 MB
@Test
public void treeTest() {
List<String> allLines = StreamUtil.readAllLines("/dict.txt");
List<String> allLines = StreamUtil.readAllLines("/sensitive_word_dict.txt");
IWordData wordData = WordDatas.tree();
wordData.initWordData(allLines);