精华内容
下载资源
问答
  • /*** @author Jeff** Copyright (c) 复制或转载...*/package chinese.utility;import java.util.Comparator;public class StrokeComparator implements Comparator {public int compare(String o1, String o2) {Ch...

    /**

    * @author Jeff

    *

    * Copyright (c) 复制或转载本文,请保留该注释。

    */

    package chinese.utility;

    import java.util.Comparator;

    public class StrokeComparator implements Comparator {

    public int compare(String o1, String o2) {

    Chinese chinese = new Chinese();

    for (int i = 0; i < o1.length() && i < o2.length(); i++) {

    int codePoint1 = o1.codePointAt(i);

    int codePoint2 = o2.codePointAt(i);

    if (codePoint1 == codePoint2)

    continue;

    int stroke1 = chinese.stroke(codePoint1);

    int stroke2 = chinese.stroke(codePoint2);

    if (stroke1 < 0 || stroke2 < 0) {

    return codePoint1 - codePoint2;

    }

    if (stroke1 != stroke2) {

    return stroke1 - stroke2;

    }

    }

    return o1.length() - o2.length();

    }

    }

    展开全文
  • 默认情况下,Graphics 绘图类使用的笔画属性是粗细为1个像素的正方形,而Java2D的Graphics2D类可以调用setStroke()方法设置笔画的属性,如改变线条的粗细、虚实和定义线段端点的形状、风格等。语法如下:setStroke...

    默认情况下,Graphics 绘图类使用的笔画属性是粗细为1个像素的正方形,而Java2D的Graphics2D类可以调用setStroke()方法设置笔画的属性,如改变线条的粗细、虚实和定义线段端点的形状、风格等。

    语法如下:

    setStroke(Stroke stroke)

    其中,参数stroke是Stroke接口的实现类。

    setStroke()方法必须接受一个Stroke接口的实现类作参数,java.awt包中提供了BasicStroke 类,它实现了Stroke接口,并且通过不同的构造方法创建笔画属性不同的对象。这些构造方法包括:

    BasicStroke()。

    BasicStroke(float width)。

    BasicStroke(float width, int cap, int join)。

    BasicStroke(float width, int cap, int join, float miterlimit)。

    BasicStroke(float width, int cap, int join, float miterlimit, float[] dash, float_phase)。

    这些构造方法中的参数说明如下:

    width:笔画宽度,此宽度必须大于或等于0.0f。如果将宽度设置为0.0f,则将笔画设置为当前设备的默认宽度

    cap:线端点的装饰

    join:应用在路径线段交汇处的装饰

    miterlimit:斜接处的裁剪限制。该参数值必须大于或等于1.0f

    dash:表示虚线模式的数组

    dash phase:开始虚线模式的偏移量

    注:Cap参数可以使用CAP_BUTT、CAP_ROUND和CAP_SQUARE常量。Join参数用于修饰线段交汇效果,可以使用JOIN_BEVEL 、JOIN_MITER 和JOIN_ROUND常量。

    以上是本文的全部内容,谢谢大家对本站的支持。

    展开全文
  • public class CnToStrokeCount {/*** 测试* @param args String[]*/public static void main(String[] args) {String cnStr = "测试数据";...System.out.print("的笔画数分别是:");for (int i = ...

    public class CnToStrokeCount {

    /**

    * 测试

    * @param args String[]

    */

    public static void main(String[] args) {

    String cnStr = "测试数据";

    char[] chars = cnStr.toCharArray();

    System.out.print("的笔画数分别是:");

    for (int i = 0; i < chars.length; i++) {

    System.out.print("*" + CnToStrokeCount.getStrokeCount(chars[i]));

    }

    System.out.println("*");

    cnStr = "CSDN - 专家门诊 - Java";

    chars = cnStr.toCharArray();

    System.out.print("的笔画数分别是:");

    for (int i = 0; i < chars.length; i++) {

    System.out.print("*" + CnToStrokeCount.getStrokeCount(chars[i]));

    }

    System.out.println("*");

    cnStr = "=====提问技巧,请大家注意!!=====";

    chars = cnStr.toCharArray();

    System.out.print("的笔画数分别是:");

    for (int i = 0; i < chars.length; i++) {

    System.out.print("*" + CnToStrokeCount.getStrokeCount(chars[i]));

    }

    System.out.println("*");

    }

    /**

    * 根据汉字字符获得笔画数,拼音和非法字符默认为0

    * @param charcator char

    * @return int

    */

    public static int getStrokeCount(char charcator) {

    byte[] bytes = (String.valueOf(charcator)).getBytes();

    if (bytes == null || bytes.length > 2 || bytes.length <= 0) {

    //错误引用,非合法字符

    return 0;

    }

    if (bytes.length == 1) {

    //英文字符

    return 0;

    }

    if (bytes.length == 2) {

    //中文字符

    int highByte = 256 + bytes[0];

    int lowByte = 256 + bytes[1];

    return getStrokeCount(highByte, lowByte);

    }

    //未知错误

    return 0;

    }

    /**

    *

    * @param highByte int:高位字节

    * @param lowByte int:低位字节

    * @return int

    */

    private static int getStrokeCount(int highByte, int lowByte) {

    if (highByte < 0xB0 || highByte > 0xF7 || lowByte < 0xA1 || lowByte > 0xFE) {

    //非GB2312合法字符

    return -1;

    }

    int offset = (highByte - 0xB0) * (0xFE - 0xA0) + (lowByte - 0xA1);

    return gb2312StrokeCount[offset];

    }

    //GB2312的字符集的笔划列表,可以参考gb2312字符全集

    private static int[] gb2312StrokeCount = {

    /* B0 */

    10, 7, 10, 10, 8, 10, 9, 11,

    17, 14, 13, 5, 13, 10, 12, 15,

    10, 6, 10, 9, 13, 8, 10, 10,

    8, 8, 10, 5, 10, 14, 16, 9,

    12, 12, 15, 15, 7, 10, 5, 5,

    7, 10, 2, 9, 4, 8, 12, 13,

    7, 10, 7, 21, 10, 8, 5, 9,

    6, 13, 8, 8, 9, 13, 12, 10,

    13, 7, 10, 10, 8, 8, 7, 8,

    7, 19, 5, 4, 8, 5, 9, 10,

    14, 14, 9, 12, 15, 10, 15, 12,

    12, 8, 9, 5, 15, 10,

    /* B1 */

    16, 13, 9, 12, 8, 8, 8, 7,

    15, 10, 13, 19, 8, 13, 12, 8,

    5, 12, 9, 4, 9, 10, 7, 8,

    12, 12, 10, 8, 8, 5, 11, 11,

    11, 9, 9, 18, 9, 12, 14, 4,

    13, 10, 8, 14, 13, 14, 6, 10,

    9, 4, 7, 13, 6, 11, 14, 5,

    13, 16, 17, 16, 9, 18, 5, 12,

    8, 9, 9, 8, 4, 16, 16, 17,

    12, 9, 11, 15, 8, 19, 16, 7,

    15, 11, 12, 16, 13, 10, 13, 7,

    6, 9, 5, 8, 9, 9,

    /* B2 */

    10, 6, 8, 11, 15, 8, 10, 8,

    12, 9, 13, 10, 14, 7, 8, 11,

    11, 14, 12, 8, 7, 10, 2, 10,

    7, 11, 4, 5, 7, 19, 10, 8,

    17, 11, 12, 7, 3, 7, 12, 15,

    8, 11, 11, 14, 16, 8, 10, 9,

    11, 11, 7, 7, 10, 4, 7, 17,

    16, 16, 15, 11, 9, 8, 12, 8,

    5, 9, 7, 19, 12, 3, 9, 9,

    9, 14, 12, 14, 7, 9, 8, 8,

    10, 10, 12, 11, 14, 12, 11, 13,

    11, 6, 11, 19, 8, 11,

    /* B3 */

    6, 9, 11, 4, 11, 7, 2, 12,

    8, 11, 10, 12, 7, 9, 12, 15,

    15, 11, 7, 8, 4, 7, 15, 12,

    7, 15, 10, 6, 7, 6, 11, 7,

    7, 7, 12, 8, 15, 10, 9, 16,

    6, 7, 10, 12, 12, 15, 8, 8,

    10, 10, 10, 6, 13, 9, 11, 6,

    7, 6, 6, 10, 8, 8, 4, 7,

    10, 5, 9, 6, 6, 6, 11, 8,

    8, 13, 12, 14, 13, 13, 13, 4,

    11, 14, 4, 10, 7, 5, 16, 12,

    18, 12, 13, 12, 9, 13,

    /* B4 */

    10, 12, 24, 13, 13, 5, 12, 3,

    9, 13, 7, 11, 12, 7, 9, 12,

    15, 7, 6, 6, 7, 8, 11, 13,

    8, 9, 13, 15, 10, 11, 7, 21,

    18, 11, 11, 9, 14, 14, 13, 13,

    10, 7, 6, 8, 12, 6, 15, 12,

    7, 5, 4, 5, 11, 11, 15, 17,

    9, 19, 16, 12, 14, 11, 13, 10,

    13, 14, 11, 14, 7, 6, 3, 14,

    15, 12, 11, 10, 13, 12, 6, 12,

    14, 5, 3, 7, 4, 12, 17, 9,

    9, 5, 9, 11, 9, 11,

    /* B5 */

    9, 10, 8, 4, 8, 10, 11, 9,

    5, 12, 7, 11, 11, 8, 11, 11,

    6, 9, 10, 9, 10, 2, 10, 17,

    10, 7, 11, 6, 8, 15, 11, 12,

    11, 15, 11, 8, 19, 6, 12, 12,

    17, 14, 4, 12, 7, 14, 8, 10,

    11, 7, 10, 14, 14, 8, 8, 6,

    12, 11, 9, 7, 10, 12, 16, 11,

    13, 13, 9, 8, 16, 9, 5, 7,

    7, 8, 11, 12, 11, 13, 13, 5,

    16, 10, 2, 11, 6, 8, 10, 12,

    10, 14, 15, 8, 11, 13,

    /* B6 */

    2, 7, 5, 7, 8, 12, 13, 8,

    4, 6, 5, 5, 12, 15, 6, 9,

    8, 9, 7, 9, 11, 7, 4, 9,

    7, 10, 12, 10, 13, 9, 12, 9,

    10, 11, 13, 12, 7, 14, 7, 9,

    12, 7, 14, 12, 14, 9, 11, 12,

    11, 7, 4, 5, 15, 7, 19, 12,

    10, 7, 9, 9, 12, 11, 9, 6,

    6, 9, 13, 6, 13, 11, 8, 12,

    11, 13, 10, 12, 9, 15, 6, 10,

    10, 4, 7, 12, 11, 10, 10, 6,

    2, 6, 5, 9, 9, 2,

    /* B7 */

    9, 5, 9, 12, 6, 4, 9, 8,

    9, 18, 6, 12, 18, 15, 8, 8,

    17, 3, 10, 4, 7, 8, 8, 5,

    7, 7, 7, 7, 4, 8, 8, 6,

    7, 6, 6, 7, 8, 11, 8, 11,

    3, 8, 10, 10, 7, 8, 8, 8,

    9, 7, 11, 7, 8, 4, 7, 7,

    12, 7, 10, 8, 6, 8, 12, 12,

    4, 9, 8, 13, 10, 12, 4, 9,

    11, 10, 5, 13, 6, 8, 4, 7,

    7, 4, 15, 8, 14, 7, 8, 13,

    12, 9, 11, 6, 9, 8,

    /* B8 */

    10, 11, 13, 11, 5, 7, 7, 11,

    10, 10, 8, 11, 12, 8, 14, 9,

    11, 18, 12, 9, 12, 5, 8, 4,

    13, 6, 12, 4, 7, 6, 13, 8,

    15, 14, 8, 7, 13, 9, 11, 12,

    3, 5, 7, 9, 9, 7, 10, 13,

    8, 11, 21, 4, 6, 9, 9, 7,

    7, 7, 12, 7, 16, 10, 10, 14,

    10, 16, 13, 15, 15, 7, 10, 14,

    12, 4, 11, 10, 8, 12, 9, 12,

    10, 12, 9, 12, 11, 3, 6, 9,

    10, 13, 10, 7, 8, 19,

    /* B9 */

    10, 10, 11, 3, 7, 5, 10, 11,

    8, 10, 4, 9, 3, 6, 7, 9,

    7, 6, 9, 4, 7, 8, 8, 9,

    8, 8, 11, 12, 11, 8, 14, 7,

    8, 8, 8, 13, 5, 11, 9, 7,

    8, 9, 10, 8, 12, 8, 5, 9,

    14, 9, 13, 8, 8, 8, 12, 6,

    8, 9, 6, 14, 11, 23, 12, 20,

    8, 6, 3, 10, 13, 8, 6, 11,

    5, 7, 9, 6, 9, 8, 9, 10,

    8, 13, 9, 8, 12, 13, 12, 12,

    10, 8, 8, 14, 6, 9,

    15, 9, 10, 10, 6, 10, 9, 12,

    14, 7, 12, 7, 11, 12, 8, 12,

    7, 16, 16, 10, 7, 16, 10, 11,

    6, 5, 5, 8, 10, 17, 17, 14,

    11, 9, 6, 10, 5, 10, 8, 12,

    10, 11, 10, 5, 8, 7, 6, 11,

    13, 9, 8, 11, 14, 14, 15, 9,

    15, 12, 11, 9, 9, 9, 10, 7,

    15, 16, 9, 8, 9, 10, 9, 11,

    9, 7, 5, 6, 12, 9, 12, 7,

    9, 10, 6, 8, 5, 8, 13, 10,

    12, 9, 15, 8, 15, 12,

    /* BB */

    8, 8, 11, 7, 4, 7, 4, 7,

    9, 6, 12, 12, 8, 6, 4, 8,

    13, 9, 7, 11, 7, 6, 8, 10,

    7, 12, 10, 11, 10, 12, 13, 11,

    10, 9, 4, 9, 12, 11, 16, 15,

    17, 9, 11, 12, 13, 10, 13, 9,

    11, 6, 9, 12, 17, 9, 12, 6,

    13, 10, 15, 5, 12, 11, 10, 11,

    6, 10, 5, 6, 9, 9, 9, 8,

    11, 13, 9, 11, 17, 9, 6, 4,

    10, 8, 12, 16, 8, 11, 5, 6,

    11, 6, 13, 15, 10, 14,

    /* BC */

    6, 5, 9, 16, 4, 7, 10, 11,

    12, 6, 7, 12, 13, 20, 12, 3,

    9, 10, 6, 7, 13, 6, 9, 2,

    10, 3, 13, 7, 16, 8, 6, 11,

    8, 11, 9, 11, 11, 4, 5, 9,

    7, 7, 7, 10, 6, 14, 9, 6,

    8, 10, 5, 9, 12, 10, 5, 10,

    11, 15, 6, 9, 8, 13, 7, 10,

    7, 6, 11, 7, 13, 10, 8, 8,

    6, 12, 9, 11, 9, 14, 12, 8,

    10, 13, 9, 11, 11, 9, 14, 13,

    12, 9, 4, 13, 15, 6,

    /* BD */

    10, 10, 9, 8, 11, 12, 10, 8,

    15, 9, 9, 10, 6, 19, 12, 10,

    9, 6, 6, 13, 8, 15, 12, 17,

    12, 10, 6, 8, 9, 9, 9, 20,

    12, 11, 11, 8, 11, 9, 7, 9,

    16, 9, 13, 11, 14, 10, 10, 5,

    12, 12, 11, 9, 11, 12, 6, 14,

    7, 5, 10, 8, 11, 13, 14, 9,

    9, 13, 8, 7, 17, 7, 9, 10,

    4, 9, 9, 8, 3, 12, 4, 8,

    4, 9, 18, 10, 13, 4, 13, 7,

    13, 10, 13, 7, 10, 10,

    /* BE */

    6, 7, 9, 14, 8, 13, 12, 16,

    8, 11, 14, 13, 8, 4, 19, 12,

    11, 14, 14, 12, 16, 8, 10, 13,

    11, 10, 8, 9, 12, 12, 7, 5,

    7, 9, 3, 7, 2, 10, 11, 11,

    5, 6, 13, 8, 12, 8, 17, 8,

    8, 10, 8, 8, 11, 7, 8, 9,

    9, 8, 14, 7, 11, 4, 8, 11,

    15, 13, 10, 5, 11, 8, 10, 10,

    12, 10, 10, 11, 8, 10, 15, 23,

    7, 11, 10, 17, 9, 6, 6, 9,

    7, 11, 9, 6, 7, 10,

    /* BF */

    9, 12, 10, 9, 10, 12, 8, 5,

    9, 4, 12, 13, 8, 12, 5, 12,

    11, 7, 9, 9, 11, 14, 17, 6,

    7, 4, 8, 6, 9, 10, 15, 8,

    8, 9, 12, 15, 14, 9, 7, 9,

    5, 12, 7, 8, 9, 10, 8, 11,

    9, 10, 7, 7, 8, 10, 4, 11,

    7, 3, 6, 11, 9, 10, 13, 8,

    14, 7, 12, 6, 9, 9, 13, 10,

    7, 13, 8, 7, 10, 12, 6, 12,

    7, 10, 8, 11, 7, 7, 3, 11,

    8, 13, 12, 9, 13, 11,

    /* C0 */

    12, 12, 12, 8, 8, 10, 7, 9,

    6, 13, 12, 8, 8, 12, 14, 12,

    14, 11, 10, 7, 13, 13, 11, 9,

    8, 16, 12, 5, 15, 14, 12, 9,

    16, 12, 9, 13, 11, 12, 10, 11,

    8, 10, 10, 10, 7, 7, 6, 8,

    9, 13, 10, 10, 11, 5, 13, 18,

    16, 15, 11, 17, 9, 16, 6, 9,

    8, 12, 13, 7, 9, 11, 11, 15,

    16, 10, 10, 13, 11, 7, 7, 15,

    5, 10, 9, 6, 10, 7, 5, 7,

    10, 4, 7, 12, 8, 9,

    /* C1 */

    12, 5, 11, 7, 8, 2, 14, 10,

    9, 12, 10, 7, 18, 13, 8, 10,

    8, 11, 11, 12, 10, 9, 8, 13,

    10, 11, 13, 7, 7, 11, 12, 12,

    9, 10, 15, 11, 14, 7, 16, 14,

    5, 15, 2, 14, 17, 14, 10, 6,

    12, 10, 6, 11, 12, 8, 17, 16,

    9, 7, 20, 11, 15, 10, 7, 8,

    9, 11, 13, 13, 10, 7, 11, 10,

    7, 10, 8, 11, 5, 5, 13, 11,

    14, 12, 13, 10, 6, 15, 10, 9,

    4, 5, 11, 8, 11, 16,

    /* C2 */

    11, 8, 8, 7, 13, 9, 12, 15,

    14, 8, 7, 5, 11, 7, 8, 11,

    7, 8, 12, 19, 13, 21, 13, 10,

    11, 16, 12, 8, 7, 15, 7, 6,

    11, 8, 10, 15, 12, 12, 10, 12,

    9, 11, 13, 11, 9, 10, 9, 13,

    7, 7, 11, 11, 7, 8, 6, 4,

    7, 7, 6, 11, 17, 8, 11, 13,

    14, 14, 13, 12, 9, 9, 9, 6,

    11, 7, 8, 9, 3, 9, 14, 6,

    10, 6, 7, 8, 6, 9, 15, 14,

    12, 13, 14, 11, 14, 14,

    /* C3 */

    13, 6, 9, 8, 8, 6, 10, 11,

    8, 13, 4, 5, 10, 5, 8, 9,

    12, 14, 9, 3, 8, 8, 11, 14,

    15, 13, 7, 9, 12, 14, 7, 9,

    9, 12, 8, 12, 3, 7, 5, 11,

    13, 17, 13, 13, 11, 11, 8, 11,

    15, 19, 17, 9, 11, 8, 6, 10,

    8, 8, 14, 11, 12, 12, 10, 11,

    11, 7, 9, 10, 12, 9, 8, 11,

    13, 17, 9, 12, 8, 7, 14, 5,

    5, 8, 5, 11, 10, 9, 8, 16,

    8, 11, 6, 8, 13, 13,

    /* C4 */

    14, 19, 14, 14, 16, 15, 20, 8,

    5, 10, 15, 16, 8, 13, 13, 8,

    11, 6, 9, 8, 7, 7, 8, 5,

    13, 14, 13, 12, 14, 4, 5, 13,

    8, 16, 10, 9, 7, 9, 6, 9,

    7, 6, 2, 5, 9, 8, 9, 7,

    10, 22, 9, 10, 9, 8, 11, 8,

    10, 4, 14, 10, 8, 16, 10, 8,

    5, 7, 7, 10, 13, 9, 13, 14,

    8, 6, 15, 15, 11, 8, 10, 14,

    5, 7, 10, 10, 19, 11, 15, 15,

    10, 11, 9, 8, 16, 5,

    /* C5 */

    8, 8, 4, 7, 9, 7, 10, 9,

    6, 7, 5, 7, 9, 3, 13, 9,

    8, 9, 17, 20, 10, 10, 8, 9,

    8, 18, 7, 11, 7, 11, 9, 8,

    8, 8, 12, 8, 11, 12, 11, 12,

    9, 19, 15, 11, 15, 9, 10, 7,

    9, 6, 8, 10, 16, 9, 7, 8,

    7, 9, 10, 12, 8, 8, 9, 11,

    14, 12, 10, 10, 8, 7, 12, 9,

    10, 8, 11, 15, 12, 13, 12, 13,

    16, 16, 8, 13, 11, 13, 8, 9,

    21, 7, 8, 15, 12, 9,

    /* C6 */

    11, 12, 10, 5, 4, 12, 15, 7,

    20, 15, 11, 4, 12, 15, 14, 16,

    11, 14, 16, 9, 13, 8, 9, 13,

    6, 8, 8, 11, 5, 8, 10, 7,

    9, 8, 8, 11, 11, 10, 14, 8,

    11, 10, 5, 12, 4, 10, 12, 11,

    13, 10, 6, 10, 12, 10, 14, 19,

    18, 12, 12, 10, 11, 8, 2, 10,

    14, 9, 7, 8, 12, 8, 8, 11,

    11, 10, 6, 14, 8, 6, 11, 10,

    6, 3, 6, 7, 9, 9, 16, 4,

    6, 7, 7, 8, 5, 11,

    /* C7 */

    9, 9, 9, 6, 8, 10, 3, 6,

    13, 5, 12, 11, 16, 10, 10, 9,

    15, 13, 8, 15, 11, 12, 4, 14,

    8, 7, 12, 7, 14, 14, 12, 7,

    16, 14, 14, 10, 10, 17, 6, 8,

    5, 16, 15, 12, 10, 9, 10, 4,

    8, 5, 8, 9, 9, 9, 9, 10,

    12, 13, 7, 15, 12, 13, 7, 8,

    9, 9, 10, 10, 11, 16, 12, 12,

    11, 8, 10, 6, 12, 7, 9, 5,

    7, 11, 7, 5, 9, 8, 12, 4,

    11, 6, 11, 8, 7, 11,

    /* C8 */

    8, 11, 17, 15, 5, 11, 23, 6,

    16, 10, 6, 11, 10, 4, 8, 4,

    10, 8, 16, 7, 13, 14, 12, 11,

    12, 13, 12, 16, 5, 9, 22, 20,

    20, 20, 5, 9, 7, 9, 12, 10,

    4, 4, 2, 7, 7, 6, 4, 3,

    7, 6, 5, 4, 4, 6, 9, 13,

    9, 16, 14, 13, 10, 9, 4, 12,

    9, 6, 9, 20, 16, 17, 6, 10,

    8, 6, 2, 15, 8, 6, 15, 13,

    12, 7, 10, 8, 10, 15, 9, 11,

    13, 17, 13, 14, 3, 8,

    /* C9 */

    6, 12, 10, 13, 8, 12, 12, 6,

    12, 13, 6, 10, 12, 14, 10, 9,

    6, 8, 7, 7, 13, 11, 13, 12,

    10, 9, 8, 7, 3, 7, 14, 8,

    5, 8, 16, 17, 16, 12, 6, 10,

    15, 14, 6, 11, 12, 10, 3, 8,

    14, 11, 10, 12, 10, 6, 3, 14,

    4, 10, 7, 8, 11, 11, 11, 6,

    8, 11, 13, 10, 13, 10, 7, 6,

    10, 5, 8, 7, 7, 11, 10, 8,

    9, 7, 8, 11, 9, 8, 13, 11,

    7, 5, 12, 9, 4, 11,

    /* CA */

    9, 11, 12, 9, 5, 6, 5, 9,

    9, 12, 8, 3, 8, 2, 5, 9,

    7, 4, 9, 9, 8, 7, 5, 5,

    8, 9, 8, 8, 6, 5, 3, 5,

    9, 8, 9, 14, 10, 8, 9, 13,

    16, 9, 5, 8, 12, 8, 4, 5,

    9, 9, 8, 8, 6, 4, 9, 6,

    7, 11, 11, 8, 14, 11, 15, 8,

    11, 10, 7, 13, 8, 12, 11, 12,

    4, 12, 11, 15, 16, 12, 17, 13,

    13, 12, 13, 12, 5, 8, 9, 7,

    6, 9, 14, 11, 13, 14,

    /* CB */

    10, 8, 9, 14, 10, 5, 5, 10,

    9, 17, 4, 11, 10, 4, 13, 12,

    7, 17, 9, 12, 9, 11, 10, 9,

    12, 15, 15, 9, 7, 5, 5, 6,

    13, 6, 13, 5, 7, 6, 8, 3,

    8, 10, 8, 10, 9, 7, 6, 9,

    12, 15, 16, 14, 7, 12, 9, 10,

    10, 12, 14, 13, 13, 11, 7, 8,

    14, 13, 14, 9, 11, 11, 10, 21,

    13, 6, 17, 12, 14, 10, 6, 10,

    10, 13, 11, 10, 14, 11, 10, 12,

    8, 13, 5, 5, 6, 12,

    /* CC */

    16, 9, 17, 15, 9, 8, 8, 5,

    10, 11, 4, 8, 7, 7, 13, 8,

    15, 13, 7, 17, 13, 15, 14, 10,

    8, 12, 10, 14, 11, 5, 9, 6,

    13, 13, 11, 12, 15, 10, 16, 10,

    15, 11, 15, 10, 11, 10, 13, 10,

    11, 10, 9, 11, 10, 5, 10, 10,

    18, 13, 10, 13, 11, 10, 15, 12,

    12, 15, 16, 12, 7, 12, 17, 11,

    10, 9, 8, 4, 11, 13, 5, 11,

    9, 14, 12, 9, 7, 8, 11, 13,

    9, 10, 8, 4, 7, 9,

    /* CD */

    5, 6, 11, 9, 9, 9, 12, 10,

    10, 13, 17, 6, 11, 7, 12, 11,

    10, 12, 9, 12, 11, 7, 5, 10,

    5, 7, 9, 8, 10, 10, 10, 11,

    3, 6, 8, 12, 6, 11, 13, 13,

    13, 14, 9, 7, 4, 17, 8, 6,

    11, 10, 7, 6, 8, 12, 7, 8,

    12, 9, 9, 12, 9, 9, 4, 10,

    9, 5, 15, 9, 12, 8, 10, 3,

    11, 7, 13, 10, 11, 12, 11, 8,

    11, 3, 12, 7, 4, 3, 8, 6,

    8, 8, 11, 7, 6, 9,

    /* CE */

    20, 13, 6, 4, 7, 10, 7, 11,

    11, 4, 14, 11, 7, 11, 8, 6,

    6, 7, 7, 5, 14, 8, 9, 9,

    12, 17, 7, 12, 11, 11, 15, 3,

    14, 12, 10, 4, 9, 7, 7, 14,

    10, 6, 13, 10, 8, 9, 13, 10,

    12, 7, 14, 8, 12, 7, 7, 7,

    9, 4, 6, 9, 9, 4, 7, 11,

    7, 7, 4, 8, 4, 10, 4, 14,

    6, 9, 7, 5, 13, 11, 8, 4,

    5, 10, 9, 8, 14, 8, 6, 11,

    8, 12, 15, 6, 13, 10,

    /* CF */

    12, 10, 7, 11, 15, 3, 11, 14,

    11, 13, 6, 12, 17, 11, 10, 3,

    13, 12, 11, 9, 7, 12, 6, 8,

    15, 9, 7, 17, 14, 13, 9, 8,

    9, 3, 12, 10, 6, 11, 13, 6,

    5, 14, 6, 9, 8, 11, 11, 7,

    9, 8, 13, 9, 9, 8, 13, 7,

    13, 11, 12, 9, 10, 8, 8, 9,

    11, 22, 9, 15, 17, 12, 3, 12,

    10, 8, 13, 9, 8, 9, 9, 15,

    13, 6, 11, 11, 12, 15, 9, 10,

    18, 12, 10, 10, 11, 10,

    /* D0 */

    3, 7, 10, 7, 11, 10, 10, 13,

    8, 13, 15, 15, 6, 9, 13, 6,

    11, 8, 11, 5, 11, 9, 19, 16,

    8, 8, 12, 10, 16, 7, 12, 8,

    7, 13, 7, 4, 9, 11, 9, 13,

    12, 12, 6, 6, 9, 7, 6, 6,

    16, 8, 7, 8, 8, 5, 4, 10,

    6, 7, 12, 14, 6, 9, 10, 6,

    13, 12, 7, 10, 10, 14, 6, 14,

    11, 14, 9, 10, 6, 13, 11, 9,

    6, 7, 10, 9, 12, 12, 11, 11,

    7, 12, 9, 11, 11, 5,

    /* D1 */

    9, 19, 10, 9, 13, 16, 8, 5,

    11, 6, 9, 14, 12, 6, 8, 6,

    6, 6, 10, 6, 5, 5, 9, 6,

    6, 8, 9, 10, 7, 3, 7, 4,

    10, 11, 13, 11, 12, 9, 6, 6,

    11, 9, 11, 10, 11, 10, 7, 9,

    12, 8, 7, 7, 15, 11, 8, 8,

    8, 11, 11, 9, 14, 10, 12, 16,

    6, 9, 12, 10, 9, 12, 10, 11,

    10, 9, 5, 10, 10, 7, 6, 8,

    8, 6, 9, 6, 10, 6, 11, 9,

    10, 14, 16, 13, 7, 14,

    /* D2 */

    13, 6, 13, 11, 12, 9, 9, 10,

    9, 9, 20, 12, 15, 8, 6, 11,

    7, 3, 6, 11, 5, 5, 6, 12,

    8, 11, 1, 12, 7, 12, 11, 8,

    6, 6, 13, 6, 12, 11, 5, 10,

    14, 7, 8, 9, 18, 12, 9, 10,

    3, 1, 7, 4, 4, 7, 8, 7,

    6, 3, 7, 17, 11, 13, 9, 6,

    13, 13, 15, 4, 3, 10, 13, 8,

    5, 10, 7, 6, 17, 11, 8, 9,

    9, 6, 10, 9, 6, 8, 7, 11,

    11, 11, 7, 4, 4, 11,

    /* D3 */

    5, 8, 15, 11, 18, 7, 14, 10,

    11, 11, 9, 14, 7, 17, 9, 15,

    13, 12, 9, 9, 8, 7, 17, 10,

    11, 13, 14, 13, 8, 8, 10, 5,

    11, 9, 5, 9, 6, 11, 7, 4,

    5, 7, 10, 7, 8, 12, 7, 6,

    4, 5, 7, 12, 9, 2, 5, 6,

    11, 3, 8, 13, 13, 13, 14, 7,

    9, 12, 8, 12, 12, 11, 11, 4,

    10, 8, 3, 6, 9, 6, 9, 6,

    5, 11, 6, 8, 6, 12, 12, 10,

    12, 13, 11, 9, 8, 13,

    /* D4 */

    10, 12, 12, 10, 15, 5, 10, 11,

    10, 4, 9, 10, 10, 12, 14, 7,

    7, 10, 13, 13, 12, 7, 8, 14,

    9, 9, 4, 6, 12, 11, 9, 8,

    12, 4, 10, 10, 10, 4, 9, 4,

    9, 4, 7, 15, 11, 10, 13, 5,

    5, 10, 6, 10, 9, 7, 10, 10,

    6, 6, 9, 19, 12, 16, 10, 10,

    12, 14, 17, 12, 19, 8, 6, 16,

    9, 20, 16, 10, 7, 7, 17, 8,

    8, 6, 8, 10, 9, 15, 15, 12,

    16, 4, 12, 12, 5, 5,

    /* D5 */

    11, 8, 9, 9, 14, 8, 5, 9,

    7, 14, 10, 6, 10, 10, 14, 18,

    9, 13, 11, 8, 10, 8, 14, 11,

    10, 22, 9, 5, 9, 10, 12, 11,

    15, 11, 14, 14, 7, 12, 10, 7,

    3, 7, 8, 5, 8, 16, 13, 8,

    9, 7, 8, 9, 13, 13, 6, 14,

    5, 14, 7, 10, 12, 16, 8, 13,

    14, 7, 10, 9, 13, 10, 13, 10,

    16, 6, 7, 8, 8, 10, 7, 15,

    10, 15, 6, 13, 9, 11, 8, 9,

    6, 8, 16, 9, 5, 9,

    /* D6 */

    9, 10, 8, 7, 6, 8, 4, 7,

    14, 8, 8, 10, 5, 3, 8, 11,

    8, 12, 12, 6, 10, 8, 7, 9,

    4, 11, 5, 6, 7, 7, 10, 11,

    6, 10, 13, 8, 9, 8, 12, 10,

    13, 8, 8, 11, 12, 8, 11, 4,

    9, 8, 9, 10, 8, 9, 8, 9,

    6, 6, 6, 8, 6, 9, 7, 12,

    9, 7, 8, 8, 10, 8, 9, 17,

    10, 10, 12, 6, 11, 10, 8, 10,

    6, 10, 12, 8, 17, 15, 5, 11,

    9, 7, 11, 8, 12, 12,

    /* D7 */

    7, 8, 9, 8, 7, 4, 9, 4,

    9, 8, 15, 14, 15, 10, 6, 12,

    6, 15, 6, 7, 12, 13, 9, 14,

    7, 11, 10, 10, 10, 8, 8, 10,

    12, 8, 10, 11, 11, 7, 9, 9,

    9, 10, 9, 12, 11, 7, 12, 5,

    9, 13, 3, 6, 11, 6, 18, 12,

    15, 8, 11, 9, 7, 7, 7, 9,

    12, 10, 7, 8, 11, 9, 7, 7,

    8, 10, 20, 16, 15, 12, 13, 12,

    15, 9, 5, 7, 9, 11, 7, 7,

    10, 0, 0, 0, 0, 0,

    /* D8 */

    3, 3, 3, 4, 4, 4, 5, 6,

    6, 10, 10, 16, 1, 8, 1, 2,

    3, 4, 4, 5, 5, 6, 9, 11,

    14, 14, 19, 1, 8, 14, 2, 6,

    4, 7, 7, 11, 14, 4, 6, 10,

    11, 12, 14, 15, 16, 2, 5, 8,

    11, 11, 15, 8, 7, 2, 4, 6,

    7, 8, 8, 8, 9, 10, 10, 10,

    13, 13, 14, 14, 15, 16, 2, 8,

    2, 4, 4, 4, 5, 5, 5, 5,

    6, 6, 6, 6, 6, 6, 6, 6,

    6, 7, 7, 7, 7, 7,

    /* D9 */

    7, 7, 7, 7, 8, 8, 8, 8,

    8, 8, 8, 8, 8, 8, 8, 8,

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 10, 10, 10, 10, 10, 10, 10,

    10, 10, 10, 10, 10, 10, 11, 11,

    11, 11, 11, 11, 11, 12, 12, 12,

    13, 14, 14, 14, 14, 14, 14, 15,

    15, 5, 6, 7, 7, 9, 17, 6,

    8, 4, 12, 16, 17, 18, 21, 2,

    9, 9, 11, 6, 6, 7, 2, 8,

    10, 10, 11, 12, 12, 12, 13, 16,

    19, 19, 2, 6, 8, 8,

    /* DA */

    10, 2, 10, 10, 2, 5, 5, 5,

    6, 6, 6, 7, 7, 7, 7, 7,

    7, 8, 8, 8, 8, 8, 8, 8,

    8, 8, 8, 8, 9, 9, 9, 9,

    10, 10, 10, 10, 10, 10, 10, 11,

    11, 11, 11, 11, 11, 11, 11, 11,

    11, 11, 12, 12, 12, 12, 12, 13,

    13, 14, 14, 14, 15, 15, 19, 2,

    8, 2, 5, 5, 6, 6, 7, 7,

    7, 7, 8, 9, 9, 10, 10, 10,

    11, 11, 11, 16, 5, 5, 5, 5,

    6, 6, 7, 7, 7, 7,

    /* DB */

    7, 7, 8, 8, 8, 8, 8, 8,

    8, 9, 9, 9, 9, 9, 10, 10,

    11, 11, 13, 13, 13, 14, 14, 16,

    19, 17, 5, 7, 5, 7, 7, 8,

    10, 10, 11, 15, 9, 17, 20, 2,

    2, 6, 10, 2, 5, 10, 12, 7,

    9, 9, 14, 16, 16, 17, 6, 6,

    6, 6, 6, 6, 6, 7, 7, 7,

    8, 8, 8, 8, 8, 8, 8, 8,

    8, 8, 9, 9, 9, 9, 9, 9,

    9, 9, 9, 10, 10, 10, 10, 10,

    10, 11, 11, 11, 11, 11,

    /* DC */

    11, 11, 11, 11, 11, 12, 12, 12,

    12, 13, 13, 14, 14, 14, 15, 20,

    21, 22, 3, 5, 5, 6, 6, 6,

    6, 6, 6, 6, 7, 7, 7, 7,

    7, 7, 7, 7, 7, 7, 7, 7,

    7, 7, 7, 7, 7, 7, 7, 7,

    7, 7, 7, 8, 8, 8, 8, 8,

    8, 8, 8, 8, 8, 8, 8, 8,

    8, 8, 8, 8, 8, 8, 9, 9,

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 9, 9, 9, 9, 9,

    /* DD */

    9, 9, 9, 9, 9, 9, 9, 10,

    10, 10, 10, 10, 10, 10, 10, 10,

    10, 10, 10, 10, 10, 10, 10, 10,

    10, 10, 10, 11, 11, 11, 11, 11,

    11, 11, 11, 11, 11, 11, 11, 11,

    11, 11, 11, 11, 11, 11, 11, 11,

    11, 11, 11, 11, 11, 12, 12, 12,

    12, 12, 12, 12, 12, 12, 12, 12,

    12, 12, 12, 12, 12, 12, 12, 13,

    13, 13, 13, 13, 13, 13, 13, 13,

    13, 13, 13, 13, 13, 13, 13, 14,

    14, 14, 14, 14, 14, 14,

    /* DE */

    14, 14, 14, 14, 15, 15, 15, 15,

    15, 15, 15, 15, 15, 16, 16, 16,

    16, 16, 16, 16, 16, 16, 17, 17,

    17, 17, 17, 18, 19, 19, 19, 20,

    20, 22, 3, 9, 6, 7, 9, 9,

    10, 10, 11, 3, 5, 5, 12, 3,

    6, 7, 8, 8, 8, 8, 9, 9,

    9, 10, 10, 10, 11, 11, 11, 11,

    11, 11, 11, 11, 11, 11, 11, 11,

    12, 12, 12, 12, 12, 12, 12, 12,

    12, 12, 13, 13, 13, 13, 13, 13,

    13, 13, 14, 14, 14, 14,

    /* DF */

    14, 15, 15, 15, 15, 16, 16, 16,

    17, 17, 19, 23, 25, 3, 7, 8,

    12, 5, 5, 5, 5, 5, 5, 6,

    6, 6, 7, 7, 7, 7, 7, 7,

    7, 7, 7, 7, 7, 8, 8, 8,

    8, 8, 8, 8, 8, 8, 8, 8,

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 9, 9, 9, 9, 9, 9, 9,

    10, 10, 10, 10, 10, 10, 10, 10,

    10, 10, 10, 11, 11, 11, 11, 11,

    11, 11, 11, 11, 11, 11,

    /* E0 */

    11, 11, 11, 11, 11, 11, 11, 11,

    12, 12, 12, 12, 12, 12, 12, 12,

    12, 12, 12, 12, 12, 12, 12, 12,

    12, 13, 13, 13, 13, 13, 13, 13,

    13, 13, 13, 13, 13, 13, 13, 13,

    13, 13, 13, 13, 13, 13, 14, 14,

    14, 14, 14, 14, 14, 14, 14, 15,

    15, 15, 15, 15, 15, 15, 15, 15,

    15, 15, 16, 16, 16, 16, 16, 16,

    17, 17, 19, 25, 3, 6, 6, 7,

    7, 8, 9, 10, 11, 11, 16, 7,

    8, 8, 8, 10, 11, 11,

    /* E1 */

    11, 12, 14, 14, 15, 15, 6, 6,

    7, 7, 7, 7, 7, 7, 7, 7,

    7, 8, 8, 8, 8, 8, 8, 8,

    8, 8, 8, 9, 9, 9, 9, 10,

    10, 11, 11, 11, 11, 11, 11, 11,

    12, 12, 12, 12, 12, 12, 12, 12,

    12, 12, 13, 13, 13, 14, 15, 15,

    17, 17, 19, 3, 7, 8, 9, 9,

    9, 10, 11, 11, 12, 13, 15, 16,

    24, 3, 3, 5, 6, 6, 6, 7,

    7, 8, 8, 8, 9, 9, 9, 9,

    10, 10, 10, 10, 10, 10,

    /* E2 */

    10, 11, 11, 11, 11, 11, 11, 11,

    12, 12, 12, 12, 12, 12, 14, 14,

    15, 15, 16, 17, 20, 6, 14, 12,

    14, 3, 3, 6, 7, 7, 7, 7,

    7, 8, 9, 10, 10, 11, 12, 12,

    13, 13, 14, 15, 15, 25, 5, 7,

    7, 8, 9, 9, 11, 11, 11, 11,

    12, 13, 14, 15, 16, 16, 17, 3,

    5, 6, 6, 7, 7, 7, 7, 7,

    7, 7, 7, 7, 7, 7, 8, 8,

    8, 8, 8, 8, 8, 8, 8, 8,

    8, 9, 9, 9, 9, 9,

    /* E3 */

    9, 9, 10, 10, 10, 10, 10, 10,

    10, 10, 11, 11, 11, 11, 11, 11,

    11, 11, 12, 12, 12, 12, 12, 12,

    12, 13, 13, 14, 15, 15, 15, 16,

    16, 18, 8, 17, 4, 6, 7, 7,

    7, 7, 9, 9, 10, 10, 10, 11,

    11, 11, 11, 11, 11, 12, 12, 13,

    13, 13, 14, 3, 4, 8, 3, 6,

    6, 6, 7, 7, 7, 7, 7, 7,

    7, 7, 7, 7, 7, 7, 8, 8,

    8, 8, 8, 8, 8, 8, 8, 8,

    8, 8, 8, 8, 8, 8,

    /* E4 */

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 9, 10, 10, 10, 10, 10, 10,

    10, 10, 10, 10, 10, 11, 11, 11,

    11, 11, 11, 11, 11, 11, 11, 11,

    11, 11, 11, 11, 12, 12, 12, 12,

    12, 12, 12, 12, 12, 12, 12, 12,

    13, 13, 13, 13, 13, 13, 13, 13,

    13, 13, 13, 13, 13, 13, 13, 13,

    13, 14, 14, 14, 14, 14, 14, 14,

    14, 14, 14, 14, 14, 14, 14, 15,

    15, 15, 15, 15, 15, 16,

    /* E5 */

    16, 16, 16, 16, 16, 17, 17, 17,

    17, 17, 19, 19, 19, 20, 20, 21,

    24, 3, 5, 8, 8, 9, 10, 12,

    13, 14, 14, 15, 16, 16, 17, 17,

    3, 7, 7, 8, 8, 8, 8, 8,

    8, 8, 9, 9, 10, 10, 10, 10,

    10, 10, 11, 11, 11, 11, 12, 12,

    12, 12, 13, 13, 13, 13, 15, 15,

    16, 16, 17, 17, 18, 3, 11, 9,

    12, 5, 9, 10, 10, 12, 14, 15,

    21, 8, 8, 9, 11, 12, 22, 3,

    6, 6, 7, 7, 7, 7,

    /* E6 */

    7, 7, 7, 7, 7, 7, 8, 8,

    8, 8, 9, 9, 9, 9, 9, 9,

    9, 10, 10, 10, 10, 10, 10, 10,

    10, 11, 11, 11, 11, 11, 11, 11,

    12, 12, 12, 12, 13, 13, 13, 13,

    13, 13, 14, 14, 14, 14, 14, 14,

    14, 15, 16, 16, 17, 17, 20, 5,

    9, 7, 8, 12, 3, 3, 8, 8,

    8, 8, 8, 8, 8, 8, 9, 9,

    9, 10, 11, 11, 11, 11, 12, 12,

    13, 13, 13, 14, 14, 15, 19, 20,

    3, 6, 6, 6, 6, 6,

    /* E7 */

    7, 7, 7, 8, 8, 8, 8, 8,

    8, 8, 9, 9, 9, 10, 10, 10,

    11, 11, 11, 11, 11, 11, 11, 11,

    11, 11, 11, 12, 12, 12, 12, 12,

    12, 12, 12, 12, 12, 13, 13, 13,

    13, 13, 13, 13, 13, 14, 14, 14,

    14, 14, 15, 15, 15, 16, 16, 16,

    16, 19, 3, 15, 3, 8, 10, 6,

    6, 8, 8, 8, 9, 9, 9, 9,

    9, 9, 9, 9, 10, 10, 10, 10,

    10, 10, 10, 10, 10, 11, 12, 12,

    12, 12, 12, 12, 12, 12,

    /* E8 */

    12, 12, 13, 13, 13, 13, 13, 14,

    14, 15, 15, 15, 15, 15, 15, 15,

    16, 17, 17, 17, 18, 20, 20, 13,

    13, 14, 7, 7, 7, 7, 7, 8,

    8, 8, 8, 8, 8, 8, 8, 8,

    8, 8, 8, 8, 9, 9, 9, 9,

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 9, 9, 9, 9, 9, 9, 10,

    10, 10, 10, 10, 10, 10, 10, 10,

    10, 10, 10, 10, 10, 10, 10, 10,

    10, 10, 11, 11, 11, 11, 11, 11,

    11, 12, 12, 12, 12, 12,

    /* E9 */

    12, 12, 12, 12, 12, 12, 12, 13,

    13, 13, 13, 13, 13, 13, 13, 13,

    13, 13, 13, 13, 13, 13, 13, 13,

    13, 13, 14, 14, 14, 14, 14, 14,

    14, 14, 14, 14, 14, 14, 14, 15,

    15, 15, 15, 15, 15, 15, 15, 16,

    16, 16, 16, 16, 16, 16, 16, 16,

    16, 16, 17, 17, 17, 17, 18, 13,

    14, 8, 9, 9, 9, 11, 11, 11,

    12, 12, 14, 16, 7, 8, 9, 9,

    9, 9, 9, 9, 9, 9, 9, 10,

    10, 10, 10, 11, 12, 12,

    /* EA */

    12, 12, 13, 15, 16, 10, 5, 8,

    11, 12, 12, 13, 13, 13, 14, 14,

    8, 9, 12, 16, 16, 17, 4, 6,

    6, 7, 8, 8, 8, 8, 8, 8,

    8, 9, 9, 9, 9, 9, 9, 10,

    10, 10, 10, 10, 10, 11, 11, 12,

    13, 13, 14, 14, 16, 18, 18, 20,

    21, 9, 9, 9, 9, 10, 10, 10,

    10, 11, 11, 11, 12, 12, 14, 9,

    10, 11, 12, 13, 14, 15, 15, 9,

    13, 6, 8, 9, 11, 11, 12, 12,

    12, 13, 14, 10, 11, 12,

    /* EB */

    14, 17, 10, 10, 12, 12, 12, 13,

    15, 16, 16, 22, 5, 6, 7, 7,

    9, 10, 10, 11, 13, 4, 11, 13,

    12, 13, 15, 9, 15, 6, 7, 7,

    7, 8, 8, 8, 8, 8, 8, 8,

    8, 9, 9, 9, 9, 9, 9, 9,

    9, 9, 9, 9, 9, 9, 10, 10,

    10, 10, 10, 10, 10, 10, 10, 11,

    11, 11, 11, 11, 11, 12, 12, 12,

    12, 12, 12, 12, 13, 13, 13, 13,

    13, 13, 13, 13, 14, 14, 14, 15,

    15, 16, 17, 17, 17, 17,

    /* EC */

    17, 16, 7, 11, 12, 13, 13, 16,

    9, 9, 12, 13, 16, 16, 4, 13,

    13, 17, 12, 15, 16, 8, 10, 10,

    10, 11, 11, 13, 14, 7, 8, 8,

    8, 9, 9, 9, 9, 9, 10, 10,

    11, 11, 11, 12, 12, 13, 13, 13,

    13, 13, 13, 13, 13, 14, 15, 15,

    15, 15, 16, 16, 16, 18, 21, 30,

    4, 11, 13, 16, 8, 8, 9, 11,

    12, 4, 7, 8, 8, 9, 9, 9,

    9, 9, 9, 9, 10, 10, 12, 12,

    13, 14, 16, 21, 7, 7,

    /* ED */

    9, 10, 10, 10, 10, 10, 10, 11,

    13, 13, 14, 16, 16, 17, 17, 24,

    4, 6, 8, 9, 12, 7, 8, 8,

    9, 9, 9, 9, 9, 9, 9, 10,

    10, 10, 10, 10, 10, 10, 10, 10,

    10, 11, 11, 11, 11, 11, 11, 11,

    11, 12, 13, 13, 13, 13, 13, 14,

    14, 14, 14, 14, 15, 15, 15, 16,

    16, 17, 17, 18, 19, 18, 21, 11,

    12, 17, 19, 8, 9, 9, 9, 9,

    9, 10, 10, 10, 11, 11, 11, 11,

    12, 12, 12, 12, 13, 13,

    /* EE */

    13, 13, 14, 14, 14, 14, 15, 15,

    16, 16, 16, 17, 18, 7, 8, 9,

    9, 9, 10, 12, 13, 17, 9, 10,

    10, 12, 13, 14, 14, 16, 17, 17,

    10, 16, 23, 5, 6, 6, 7, 7,

    7, 8, 8, 8, 8, 8, 8, 9,

    9, 9, 9, 9, 9, 9, 9, 9,

    9, 10, 10, 10, 10, 10, 10, 10,

    10, 10, 10, 10, 10, 10, 10, 10,

    10, 10, 10, 10, 11, 11, 11, 11,

    11, 11, 11, 11, 11, 11, 11, 11,

    11, 11, 11, 11, 11, 11,

    /* EF */

    11, 11, 11, 11, 11, 11, 11, 11,

    12, 12, 12, 12, 12, 12, 12, 12,

    12, 12, 12, 12, 12, 12, 12, 12,

    12, 13, 13, 13, 13, 13, 13, 13,

    13, 13, 13, 13, 13, 14, 14, 14,

    14, 14, 14, 14, 14, 14, 14, 14,

    14, 15, 15, 15, 15, 15, 15, 15,

    15, 16, 16, 16, 16, 16, 16, 16,

    16, 17, 17, 17, 17, 17, 17, 17,

    17, 17, 17, 18, 18, 18, 19, 20,

    14, 9, 12, 13, 9, 9, 10, 10,

    11, 12, 12, 12, 13, 13,

    /* F0 */

    15, 15, 16, 17, 18, 22, 9, 11,

    12, 13, 17, 10, 11, 7, 7, 8,

    9, 9, 10, 10, 10, 10, 10, 10,

    11, 11, 11, 11, 11, 12, 12, 12,

    12, 12, 12, 13, 13, 13, 13, 13,

    14, 14, 14, 14, 14, 15, 15, 16,

    16, 16, 17, 17, 17, 17, 18, 18,

    22, 5, 7, 7, 8, 8, 9, 9,

    10, 10, 10, 10, 10, 10, 10, 10,

    11, 11, 12, 12, 12, 12, 12, 12,

    13, 13, 13, 13, 13, 13, 13, 14,

    14, 14, 14, 14, 14, 14,

    /* F1 */

    15, 15, 15, 15, 16, 16, 16, 16,

    16, 16, 16, 16, 17, 18, 18, 18,

    18, 21, 23, 11, 12, 8, 8, 9,

    9, 10, 11, 13, 13, 14, 14, 14,

    15, 5, 8, 9, 9, 9, 9, 10,

    11, 11, 11, 11, 12, 12, 12, 12,

    13, 13, 13, 13, 13, 13, 14, 14,

    14, 14, 14, 15, 15, 16, 17, 19,

    24, 5, 9, 11, 12, 9, 6, 9,

    10, 12, 12, 13, 14, 15, 15, 16,

    16, 22, 12, 8, 11, 11, 11, 12,

    15, 16, 12, 9, 10, 10,

    /* F2 */

    12, 12, 12, 12, 13, 15, 15, 16,

    16, 16, 18, 20, 21, 6, 10, 7,

    8, 9, 9, 9, 9, 10, 10, 10,

    10, 10, 10, 10, 10, 10, 10, 11,

    11, 11, 11, 11, 11, 11, 11, 11,

    11, 11, 12, 12, 12, 12, 12, 12,

    12, 12, 12, 12, 12, 12, 13, 13,

    13, 13, 13, 13, 13, 13, 14, 14,

    14, 14, 14, 14, 14, 14, 14, 14,

    14, 14, 14, 14, 15, 15, 15, 15,

    15, 15, 15, 15, 15, 15, 15, 15,

    15, 15, 16, 16, 16, 16,

    /* F3 */

    16, 16, 16, 16, 16, 16, 17, 17,

    17, 17, 17, 17, 17, 17, 17, 17,

    17, 18, 18, 18, 18, 19, 19, 19,

    19, 20, 21, 24, 26, 6, 14, 17,

    17, 10, 8, 9, 9, 9, 10, 10,

    10, 10, 10, 11, 11, 11, 11, 11,

    11, 11, 11, 11, 11, 11, 11, 12,

    12, 12, 12, 12, 12, 13, 13, 13,

    13, 13, 13, 14, 14, 14, 14, 14,

    14, 14, 14, 14, 14, 14, 14, 15,

    15, 15, 15, 16, 16, 16, 16, 16,

    17, 17, 17, 17, 17, 17,

    /* F4 */

    18, 18, 18, 19, 19, 19, 8, 9,

    11, 12, 10, 10, 9, 9, 9, 10,

    10, 10, 10, 11, 11, 11, 11, 12,

    13, 13, 14, 15, 17, 18, 19, 10,

    10, 11, 13, 13, 19, 11, 11, 13,

    15, 15, 16, 9, 10, 10, 11, 11,

    12, 12, 13, 14, 14, 14, 15, 15,

    15, 15, 15, 16, 18, 6, 15, 9,

    11, 12, 14, 14, 15, 15, 16, 17,

    6, 12, 14, 14, 17, 25, 11, 19,

    9, 12, 13, 13, 23, 11, 15, 10,

    11, 9, 10, 10, 10, 12,

    /* F5 */

    12, 12, 13, 13, 13, 14, 14, 14,

    14, 14, 15, 15, 16, 16, 16, 17,

    17, 18, 19, 19, 19, 20, 20, 21,

    7, 16, 10, 13, 14, 18, 18, 10,

    10, 11, 11, 11, 12, 12, 12, 12,

    12, 12, 12, 12, 13, 13, 13, 13,

    13, 13, 13, 14, 14, 15, 15, 15,

    15, 15, 15, 15, 15, 16, 16, 16,

    16, 16, 16, 16, 16, 17, 17, 17,

    19, 19, 19, 19, 19, 20, 21, 22,

    22, 23, 24, 7, 12, 13, 13, 17,

    17, 11, 11, 12, 12, 13,

    /* F6 */

    13, 14, 15, 13, 18, 12, 11, 12,

    12, 14, 14, 16, 16, 16, 19, 19,

    20, 22, 10, 13, 13, 13, 14, 14,

    15, 15, 17, 8, 12, 20, 8, 10,

    10, 13, 14, 18, 18, 14, 14, 15,

    16, 17, 18, 18, 21, 24, 12, 12,

    13, 13, 13, 13, 13, 13, 13, 13,

    14, 14, 14, 14, 14, 14, 14, 14,

    15, 15, 15, 15, 15, 15, 15, 15,

    15, 15, 16, 16, 16, 16, 16, 16,

    16, 16, 16, 16, 16, 16, 17, 17,

    17, 17, 17, 17, 17, 17,

    /* F7 */

    18, 18, 18, 18, 18, 19, 19, 19,

    19, 19, 19, 20, 20, 20, 21, 14,

    14, 15, 15, 16, 18, 18, 18, 19,

    19, 13, 13, 14, 14, 14, 15, 15,

    17, 17, 18, 18, 19, 19, 22, 14,

    14, 15, 16, 16, 17, 19, 12, 15,

    18, 22, 22, 10, 13, 14, 15, 15,

    16, 16, 16, 18, 19, 20, 23, 25,

    14, 15, 17, 13, 16, 16, 17, 19,

    19, 21, 23, 17, 17, 17, 18, 18,

    19, 20, 20, 20, 20, 21, 17, 18,

    20, 23, 23, 16, 17, 23,

    /* F8 */

    }

    }

    展开全文
  • 对于包含汉字的字符串来说,排序的方式主要有两种:一种是拼音,一种是笔画。本文就讲述如何实现按笔划排序的比较器(Comparator)。作者:Jeff发表于:2007年12月21日 11:27 最后更新于:2007年12月21日 12:38版权...

    对于包含汉字的字符串来说,排序的方式主要有两种:一种是拼音,一种是笔画。

    本文就讲述如何实现按笔划排序的比较器(Comparator)。

    作者:Jeff 发表于:2007年12月21日 11:27 最后更新于: 2007年12月21日 12:38

    版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明。

    http://www.blogjava.net/jeff-lau/archive/2007/12/21/169257.html

    笔画排序

    要按笔画排序,就要实现笔画比较器。

    class StokeComparator implements Comparator

    如果有个方法可以求得汉字的笔画数,上面的功能就很容易实现。如何求一个汉字的笔画数?最容易想到的就是查表法。建一个汉字笔画数表,如:

    汉字

    Unicode编码

    笔画数

    U4E00

    1

    U4E8C

    2

    U9F8D

    16

    ...

    ...

    ...

    表二

    如果是连续的、按unicode编码排好顺序的表,实际存储在笔画数表中的只需最后一列就够了。

    那如何建这个表呢?这个表存储在哪里?

    建汉字笔画数表

    现在大多数系统还只能支持Unicode中的基本汉字那部分汉字,编码从U9FA6-U9FBF。所以我们只建这部分汉字的笔画表。汉字笔画数表,我们可以按照下面的方法生成:

    用java程序生成一个文本文件(Chinese.csv)。包括所有的从U9FA6-U9FBF的字符的编码和文字。利用excel的按笔画排序功能,对Chinese.csv文件中的内容排序。

    编写Java程序分析Chinese.csv文件,求得笔画数, 生成ChineseStroke.csv。矫正笔画数,重新按汉字的Unicode编码对ChineseStroke.csv文件排序。

    只保留ChineseStroke.csv文件的最后一列,生成Stroke.csv。

    生成Chinese.csv的Java程序

    1 /**2 * @author Jeff3 *4 * Copyright (c) 复制或转载本文,请保留该注释。5 */

    6 package chinese.utility.preface;7

    8 import java.io.IOException;9 import java.io.PrintWriter;10

    11 public classChineseCoder {12

    13 public static voidmain(String[] args) throws IOException {14 PrintWriter out = new PrintWriter("Chinese.csv");15 //基本汉字

    16 for (char c = 0x4E00; c <= 0x9FA5; c++) {17 out.println((int) c + "," +c);18 }19 out.flush();20 out.close();21

    22 }23

    24 }

    初始化笔画数

    从Excel排序过后的Chinese.csv文件来看,排好序的文件还是有一定规律的。在文件的第9行-12行可以看出:逐行扫描的时候,当unicode会变小了,笔画数也就加1。

    20059,乛

    20101,亅

    19969,丁

    19970,丂

    用下面的Java程序分析吧。

    1 /**2 * @author Jeff3 *4 * Copyright (c) 复制或转载本文,请保留该注释。5 */

    6 package chinese.utility.preface;7

    8 import java.io.File;9 import java.io.IOException;10 import java.io.PrintWriter;11 import java.util.Scanner;12

    13 public classStroke {14

    15 /**16 * @param args17 * @throws IOException18 */

    19 public static voidmain(String[] args) throws IOException {20 Scanner in = new Scanner(new File("Chinese.csv"));21 PrintWriter out = new PrintWriter("ChineseStroke.csv");22 String oldLine = "999999";23 int stroke = 0;24 while (in.hasNextLine()) {25 String line = in.nextLine();26 if (line.compareTo(oldLine) < 0) {27 stroke++;28 }29 oldLine =line;30 out.println(line + "," +stroke);31 }32 out.flush();33 out.close();34 in.close();35 }36

    37 }

    上面用的这个规律有问题吗?有问题,从ChineseStroke.csv文件抽取最后几个汉字就发现,笔画数不对。为什么呢?

    笔画数可能不是连续的。

    n+1笔画数的最小Unicode码可能比n笔画数的最大Unicode码要大

    我们要人工核对ChineseStroke文件,但只要核对在笔画变化的那几个汉字的笔画数。最后,我发现,只有笔画数多于30的少数几个汉字的笔画数不对。核对并矫正笔画数后,用Excel按Unicode重新排序,去掉汉字和Unicode两列,只保留笔画数那列,得到Stroke.csv文件。

    求得笔画数的方法和笔画比较器方法

    求得笔画数的方法测试代码:

    1 /**2 * @author Jeff3 *4 * Copyright (c) 复制或转载本文,请保留该注释。5 */

    6 package chinese.utility.test;7

    8 import staticorg.junit.Assert.assertEquals;9

    10 import org.junit.Before;11 import org.junit.Test;12 import chinese.utility.Chinese;13

    14 public classStrokeTest {15

    16 Chinese chinese;17

    18 @Before19 public voidsetUp() {20 chinese = newChinese();21 }22

    23 @Test24 public voidtestStroke() {25 assertEquals(1, chinese.stroke('一'));26 }27

    28 @Test29 public voidtestStroke2() {30 assertEquals(2, chinese.stroke('二'));31 }32

    33 @Test34 public voidtestStroke16() {35 assertEquals(16, chinese.stroke('龍'));36 }37

    38 @Test39 public voidtestStrokeABC() {40 assertEquals(-1, chinese.stroke('a'));41 }42

    43 }

    求得笔画数的方法代码

    1 /**2 * @author Jeff3 *4 * Copyright (c) 复制或转载本文,请保留该注释。5 */

    6 package chinese.utility;7

    8 import java.util.Comparator;9

    10 public class StrokeComparator implements Comparator{11

    12 public intcompare(String o1, String o2) {13

    14 Chinese chinese = newChinese();15

    16 for (int i = 0; i < o1.length() && i < o2.length(); i++) {17 int codePoint1 =o1.codePointAt(i);18 int codePoint2 =o2.codePointAt(i);19 if (codePoint1 ==codePoint2)20 continue;21

    22 int stroke1 =chinese.stroke(codePoint1);23 int stroke2 =chinese.stroke(codePoint2);24

    25 if (stroke1 < 0 || stroke2 < 0) {26 return codePoint1 -codePoint2;27 }28

    29 if (stroke1 !=stroke2) {30 return stroke1 -stroke2;31 }32 }33

    34 return o1.length() -o2.length();35 }36 }

    笔画比较器测试

    1 /**2 * @author Jeff3 *4 * Copyright (c) 复制或转载本文,请保留该注释。5 */

    6 package chinese.utility.test;7

    8 import java.util.Comparator;9

    10 import org.junit.Assert;11 import org.junit.Before;12 import org.junit.Test;13

    14 import chinese.utility.StrokeComparator;15

    16 public classStrokeComparatorTest {17

    18 private Comparatorcomparator;19

    20 @Before21 public voidsetUp() {22 comparator = newStrokeComparator();23 }24

    25 /**26 * 相同笔画数27 */

    28 @Test29 public voidtestCompareEquals() {30 Assert.assertTrue(comparator.compare("一", "丨") == 0);31 }32

    33 /**34 * 不同笔画数35 */

    36 @Test37 public voidtestCompare() {38 Assert.assertTrue(comparator.compare("一", "二") < 0);39 Assert.assertTrue(comparator.compare("唔", "马") > 0);40 }41

    42 /**43 * 长度不同44 */

    45 @Test46 public voidtestCompareDefficultLength() {47 Assert.assertTrue(comparator.compare("二", "二一") < 0);48 }49

    50 /**51 * 非汉字的比较52 */

    53 @Test54 public voidtestABC() {55 Assert.assertTrue(comparator.compare("一", "a") > 0);56 Assert.assertTrue(comparator.compare("a", "b") < 0);57 }58 }

    笔画比较器

    1 /**2 * @author Jeff3 *4 * Copyright (c) 复制或转载本文,请保留该注释。5 */

    6 package chinese.utility.test;7

    8 import java.util.Comparator;9

    10 import org.junit.Assert;11 import org.junit.Before;12 import org.junit.Test;13

    14 import chinese.utility.StrokeComparator;15

    16 public classStrokeComparatorTest {17

    18 private Comparatorcomparator;19

    20 @Before21 public voidsetUp() {22 comparator = newStrokeComparator();23 }24

    25 /**26 * 相同笔画数27 */

    28 @Test29 public voidtestCompareEquals() {30 Assert.assertTrue(comparator.compare("一", "丨") == 0);31 }32

    33 /**34 * 不同笔画数35 */

    36 @Test37 public voidtestCompare() {38 Assert.assertTrue(comparator.compare("一", "二") < 0);39 Assert.assertTrue(comparator.compare("唔", "马") > 0);40 }41

    42 /**43 * 长度不同44 */

    45 @Test46 public voidtestCompareDefficultLength() {47 Assert.assertTrue(comparator.compare("二", "二一") < 0);48 }49

    50 /**51 * 非汉字的比较52 */

    53 @Test54 public voidtestABC() {55 Assert.assertTrue(comparator.compare("一", "a") > 0);56 Assert.assertTrue(comparator.compare("a", "b") < 0);57 }58 }

    其他程序的汉字排序

    Microsoft在这方面做得比较好。如Sql server 2000,Word和Excel都能按拼音和笔画排序。而Oracle只能是采取宽松拼音排序法。

    展开全文
  • public int getStrokeCount(char charcator) { byte[] bytes = (String.valueOf(charcator)).getBytes();... } /// /// 获取字符串中所有汉字的笔画总和 /// /// 字符串 /// public int GetStrokeCount(String Words){
  • public class CnToStrokeCount {/*** 测试* @param args String[]*/public static void main(String[] args) {String cnStr = "测试数据";...System.out.print("的笔画数分别是:");for (int i = ...
  • java中文汉字笔画排序

    2017-07-27 13:36:26
    利用java对基本汉字(unicode编码4E00-9FA5)进行笔画排序
  • java汉字笔画排序源码

    2018-01-06 15:13:33
    原文地址:http://blog.csdn.net/u013271384/article/details/76549368
  • java获取汉字笔画

    2019-02-20 17:42:32
    java获取汉字笔画数 前段时间做个项目,主要是中文验证码识别,分为了几类问题,一类是得出某个汉字的笔画数,在网上搜了一下,基本方法都是大同小异,都是通过查GB2312的字符集的笔划列表。下面给出源代码。 稍有...
  • 计算汉字笔画java实现

    热门讨论 2012-09-08 12:50:18
    计算汉字笔画数,用java实现 计算汉字笔画数,用java实现
  • java实现计算汉字笔画

    2020-06-22 15:35:24
    汉字笔画计算 可用于人名笔画计算 核心代码来自互联网 我只添加了某些方法 package com.lhdz.core.util; /** 计算汉字笔画 */ public class CnToStrokeCountUtil { //需要计算的汉字 只需要调用该方法即可 public ...
  • Java 汉字 拼音 部首 笔画 笔画数目 Java,获取汉字拼音、部首、笔画笔画数目源文件、源码
  • 在oracle9i中新增了按照拼音、部首、笔画排序功能。设置NLS_SORT值SCHINESE_RADICAL_M 按照部首(第一顺序)、笔划(第二顺序)排序SCHINESE_STROKE_M 按照笔划(第一顺序)、部首(第二顺序)排序SCHINESE_PINYIN_M 按照...
  • Java之实现简单中文笔画验证码 开发工具与关键技术:Java[MyEclipse 10] 作者:谢景 撰写时间:2019-5-06 在做项目中我们为了防止别人恶意提交,我们会进行验证码验证登录,我们常用的是随机验证码校对,例如下面...
  • Java调用setStroke()方法设置笔画属性的语法 原创发布时间:2020-09-04 09:26:08来源:脚本之家阅读:144作者:司机默认情况下,Graphics 绘图类使用的笔画属性是粗细为1个像素的正方形,而Java2D的Graphics2D类可以...
  • java实现汉字的笔画数源代码,理解学习java
  • 默认情况下,Graphics 绘图类使用的笔画属性是粗细为1个像素的正方形,而Java2D的Graphics2D类可以调用setStroke()方法设置笔画的属性,如改变线条的粗细、虚实和定义线段端点的形状、风格等。语法如下:setStroke...
  • * 获取中文笔画顺序及笔数 * @author 杨红杰 * @date 2019/10/24 14:46 */ public class BiHua { public static void main(String[] args) throws Exception { String str = "我爱你中国"; System.out....
  • 默认情况下,graphics 绘图类使用的笔画属性是粗细为1个像素的正方形,而java2d的graphics2d类可以调用setstroke()方法设置笔画的属性,如改变线条的粗细、虚实和定义线段端点的形状、风格等。语法如下:setstroke...
  • import java.awt.Font; import java.awt.Shape; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.geom.AffineTransform; import java.util.Scanner; pu
  • import java.awt.*; import java.util.Random; public class FishJPanel extends JPanel implements Runnable { private int[] aa = new int[10];//设置一个数组获得图形x,y轴坐标 private int[] bb = new int[10];...
  • 默认情况下,graphics 绘图类使用的笔画属性是粗细为1个像素的正方形,而java2d的graphics2d类可以调用setstroke()方法设置笔画的属性,如改变线条的粗细、虚实和定义线段端点的形状、风格等。语法如下:setstroke...
  • [原创]Java调用setStroke()方法设置笔画属性的语法发布于 2020-7-23|复制链接摘记: 默认情况下,Graphics 绘图类使用的笔画属性是粗细为1个像素的正方形,而Java2D的Graphics2D类可以调用setStroke()方法设置笔画的...
  • JAVA学习绘图颜色及其笔画属性设置字体显示文字 package com.graphics; import java.awt.*; import java.awt.geom.Rectangle2D; import java.util.Date; import javax.swing.*; /** ...
  • java实现汉字的笔画

    千次阅读 热门讨论 2010-07-08 22:05:00
    核心代码来自互联网,为了更容易测试,我做了个简单的界面。 Code: import java.awt.Color; import java.awt.Font; import java.awt.Insets; import java.awt.event.ActionE
  • 人物脸部简笔画图片欣赏人物脸部简笔画图片1人物脸部简笔画图片2人物脸部简笔画图片3人物脸部简笔画图片4人物脸部简笔画图片5欣赏完人物脸部简笔画图片之后,请和小编一起看一些关于简笔画的介绍。简笔画的基本功1....
  • JAVA 实现汉字五行笔画查询

    千次阅读 2014-02-08 11:04:02
    import java.util.ArrayList; /**汉字五行笔画库 * * @author luozhuang 大师♂罗莊 */ public class BhWxLib { private ArrayList<MetaLibItem> libs = new ArrayList(); /** * 以数理来划分五...

空空如也

空空如也

1 2 3 4 5 ... 14
收藏数 275
精华内容 110
关键字:

java笔画

java 订阅