workflow.py 文件源码

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

项目:alfred-zebra 作者: r0x73 项目源码 文件源码
def fold_to_ascii(self, text):
        """Convert non-ASCII characters to closest ASCII equivalent.

        .. versionadded:: 1.3

        .. note:: This only works for a subset of European languages.

        :param text: text to convert
        :type text: ``unicode``
        :returns: text containing only ASCII characters
        :rtype: ``unicode``

        """
        if isascii(text):
            return text
        text = ''.join([ASCII_REPLACEMENTS.get(c, c) for c in text])
        return unicode(unicodedata.normalize('NFKD',
                       text).encode('ascii', 'ignore'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号