Browse Source

Merge remote-tracking branch 'origin/master'

xufei 2 years ago
parent
commit
655b09a801

+ 9 - 0
src/main/java/com/winhc/bigdata/udf/string/FindTraditional2SimpleError.java

@@ -12,8 +12,14 @@ import java.util.stream.Collectors;
 /**
  * @author: XuJiakai
  * 2022/3/4 10:31
+ * <p>
+ * func name: find_traditional_2_simple_error
  */
 public class FindTraditional2SimpleError extends UDF {
+    /**
+     * @param val
+     * @return true:相同,false:转换异常
+     */
     public Boolean evaluate(String cname, String historyNames) {
         if (StringUtils.isEmpty(cname) && StringUtils.isEmpty(historyNames)) {
             return true;
@@ -48,5 +54,8 @@ public class FindTraditional2SimpleError extends UDF {
         System.out.println(simple.evaluate("文徵明",null));
         System.out.println(simple.evaluate("徵信",null));
         System.out.println(simple.evaluate("瞭望",null));
+        String name = "合得五金錶帶塑膠有限公司";
+        System.out.println(ChineseHelper.convertToSimplifiedChinese(name));
+        System.out.println(ZhConverterUtil.toSimple(name));
     }
 }