Programmatically determine number of strokes in a Chinese character?

前端 未结 5 1629
庸人自扰
庸人自扰 2021-02-07 22:03

Does Unicode store stroke count information about Chinese, Japanese, or other stroke-based characters?

5条回答
  •  误落风尘
    2021-02-07 22:37

    In Python there is a library for that:

    >>> from cjklib.characterlookup import CharacterLookup
    >>> cjk = CharacterLookup('C')
    >>> cjk.getStrokeCount(u'日')
    4
    

    Disclaimer: I wrote it

提交回复
热议问题