transliterator.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:indic_transliteration 作者: sanskrit-coders 项目源码 文件源码
def __init__(self, unicodeHexValue, block):
        """ Set up a unicode character.

        Arguments:
        unicodeHexValue -- an integer that should correspond to a 
                           Unicode code point.
        block -- the CharacterBlock this character belongs to.

        Raises:
        ValueError -- if unicodeHexValue is not a valid code point.

        """
        if unicodeHexValue < 0 or unicodeHexValue > 0x10FFFF:
            raise (ValueError, "numeric value outside Unicode range")
        self.unicodeHexValue = unicodeHexValue
        """ Use name check to filter out unused characters.
              unicodedata.name() raises ValueError for these
        """
        self.chr = chr(self.unicodeHexValue)
        self.name = unicodedata.name(self.chr)
        self.equivalents = {}
        self._block = block
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号