From 00f888e347197bc2ec9143638f006dc1421a185a Mon Sep 17 00:00:00 2001 From: "binbin.hou" Date: Fri, 5 Sep 2025 18:01:00 +0800 Subject: [PATCH] v0.29.3 opt --- pom.xml | 4 ++-- .../format/WordFormatIgnoreChineseStyle.java | 14 +++----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index de6838b..216013c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.houbb sensitive-word - 0.29.2 + 0.29.3-SNAPSHOT @@ -26,7 +26,7 @@ 0.13.0 - 1.8.1 + 1.14.0-SNAPSHOT 1.0.0 diff --git a/src/main/java/com/github/houbb/sensitive/word/support/format/WordFormatIgnoreChineseStyle.java b/src/main/java/com/github/houbb/sensitive/word/support/format/WordFormatIgnoreChineseStyle.java index 456ae5d..1b31df6 100644 --- a/src/main/java/com/github/houbb/sensitive/word/support/format/WordFormatIgnoreChineseStyle.java +++ b/src/main/java/com/github/houbb/sensitive/word/support/format/WordFormatIgnoreChineseStyle.java @@ -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 mappingList = ZhConverterUtil.toSimple(original); - if(CollectionUtil.isEmpty(mappingList)) { - return original; - } - - return mappingList.get(0).charAt(0); + return ZhSlimUtil.toSimple(original); } }