itb_util.py 文件源码

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

项目:ibus-typing-booster 作者: mike-fabian 项目源码 文件源码
def contains_letter(text):
    '''Returns whether “text” contains a “letter” type character

    :param text: The text to check
    :type text: string
    :rtype: boolean

    Examples:

    >>> contains_letter('Hi!')
    True

    >>> contains_letter(':-)')
    False
    '''
    for char in text:
        category = unicodedata.category(char)
        if category in ('Ll', 'Lu', 'Lo',):
            return True
    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号