Commit 3a6a98d57480677ff3c216c8a29a28366631bf02

Authored by yanghl
1 parent 7e0691c7

文字替换符号处理。

src/main/java/com/xly/util/AdvancedSymbolRemover.java
@@ -38,10 +38,11 @@ public class AdvancedSymbolRemover { @@ -38,10 +38,11 @@ public class AdvancedSymbolRemover {
38 text = text.replaceAll("(?<!\\d)-(?![\\d.])|(?<=\\d)-", ""); 38 text = text.replaceAll("(?<!\\d)-(?![\\d.])|(?<=\\d)-", "");
39 39
40 // ============================ 40 // ============================
41 - // 🔥 核心:只保留 中文、英文、数字、小数点、负号、空格  
42 - // 其他所有符号全部清空! 41 + // 🔥 修正版:保留 中文、英文、数字、小数点、负号、空格
  42 + // 🔥 额外保留:中文标点 。,、;:?!
  43 + // 只删除 * # @ % ^ & 等特殊符号
43 // ============================ 44 // ============================
44 - text = text.replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5\\-. ]", ""); 45 + text = text.replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5\\-. 。,、;:?!]", "");
45 46
46 // 多余空格变成单个空格(更干净) 47 // 多余空格变成单个空格(更干净)
47 text = text.replaceAll("\\s+", " ").trim(); 48 text = text.replaceAll("\\s+", " ").trim();