@@ -0,0 +1,1705 @@
+package com.andyadc.scaffold.util;%0A%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A/**%0A * @author andaicheng%0A */%0Apublic class ChineseUtil %7B%0A%0A    /**%0A     * %E5%88%A4%E6%96%AD%E5%AD%97%E7%AC%A6%E6%98%AF%E5%90%A6%E6%98%AF%E4%B8%AD%E6%96%87%0A     *%0A     * @param c %E5%AD%97%E7%AC%A6%0A     * @return %E6%98%AF%E5%90%A6%E6%98%AF%E4%B8%AD%E6%96%87%0A     */%0A    public static boolean isChinese(char c) %7B%0A        Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);%0A        if (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS%0A                %7C%7C ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS%0A                %7C%7C ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A%0A                %7C%7C ub == Character.UnicodeBlock.GENERAL_PUNCTUATION%0A                %7C%7C ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION%0A                %7C%7C ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) %7B%0A            return true;%0A        %7D%0A        return false;%0A    %7D%0A%0A    /**%0A     * %E5%88%A4%E6%96%AD%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E6%98%AF%E4%B9%B1%E7%A0%81%0A     *%0A     * @param strName %E5%AD%97%E7%AC%A6%E4%B8%B2%0A     * @return %E6%98%AF%E5%90%A6%E6%98%AF%E4%B9%B1%E7%A0%81%0A     */%0A    public static boolean isMessyCode(String strName) %7B%0A        Pattern p = Pattern.compile(%22%5C%5Cs*%7C%5Ct*%7C%5Cr*%7C%5Cn*%22);%0A        Matcher m = p.matcher(strName);%0A        String after = m.replaceAll(%22%22);%0A        String temp = after.replaceAll(%22%5C%5Cp%7BP%7D%22, %22%22);%0A        char%5B%5D ch = temp.trim().toCharArray();%0A        float chLength = ch.length;%0A        float count = 0;%0A        for (int i = 0; i %3C ch.length; i++) %7B%0A            char c = ch%5Bi%5D;%0A            if (!Character.isLetterOrDigit(c)) %7B%0A                if (!isChinese(c)) %7B%0A                    count = count + 1;%0A                %7D%0A            %7D%0A        %7D%0A        float result = count / chLength;%0A        if (result %3E 0.4) %7B%0A            return true;%0A        %7D else %7B%0A            return false;%0A        %7D%0A    %7D%0A%0A%7D%0A

add utility ChineseUtil