mirror of
https://github.com/houbb/sensitive-word.git
synced 2026-03-22 08:27:36 +08:00
release branch 0.15.0
This commit is contained in:
@@ -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 |
|
||||
|
||||
@@ -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>
|
||||
```
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -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 ==============================-->
|
||||
|
||||
@@ -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
|
||||
:::: 项目名称
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
package ai.com.github.houbb.sensitive.word.utils;
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user