mirror of
https://github.com/houbb/sensitive-word.git
synced 2026-03-22 08:27:36 +08:00
v0.29.3 opt
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -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 ==============================-->
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user