v0.29.3 opt

This commit is contained in:
binbin.hou
2025-09-05 18:01:00 +08:00
parent dbbef1c914
commit 00f888e347
2 changed files with 5 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
<version>0.29.2</version>
<version>0.29.3-SNAPSHOT</version>
<properties>
<!--============================== All Plugins START ==============================-->
@@ -26,7 +26,7 @@
<!--============================== INTER ==============================-->
<heaven.version>0.13.0</heaven.version>
<opencc4j.version>1.8.1</opencc4j.version>
<opencc4j.version>1.14.0-SNAPSHOT</opencc4j.version>
<sensitive-word-data.version>1.0.0</sensitive-word-data.version>
<!--============================== OTHER ==============================-->

View File

@@ -1,12 +1,9 @@
package com.github.houbb.sensitive.word.support.format;
import com.github.houbb.heaven.annotation.ThreadSafe;
import com.github.houbb.heaven.util.util.CollectionUtil;
import com.github.houbb.opencc4j.util.ZhConverterUtil;
import com.github.houbb.sensitive.word.api.IWordFormat;
import com.github.houbb.opencc4j.util.ZhSlimUtil;
import com.github.houbb.sensitive.word.api.IWordContext;
import java.util.List;
import com.github.houbb.sensitive.word.api.IWordFormat;
/**
* 忽略中文样式
@@ -24,12 +21,7 @@ public class WordFormatIgnoreChineseStyle implements IWordFormat {
@Override
public char format(char original, IWordContext context) {
List<String> mappingList = ZhConverterUtil.toSimple(original);
if(CollectionUtil.isEmpty(mappingList)) {
return original;
}
return mappingList.get(0).charAt(0);
return ZhSlimUtil.toSimple(original);
}
}