__main__.py 文件源码

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

项目:ipapy 作者: pettarin 项目源码 文件源码
def command_chars(string, vargs):
    """
    Print a list of all IPA characters in the given string.

    It will print the Unicode representation, the full IPA name,
    and the Unicode "U+"-prefixed hexadecimal codepoint representation
    of each IPA character.

    :param str string: the string to act upon
    :param dict vargs: the command line arguments
    """
    try:
        ipa_string = IPAString(
            unicode_string=string,
            ignore=vargs["ignore"],
            single_char_parsing=vargs["single_char_parsing"]
        )
        for c in ipa_string:
            print(u"'%s'\t%s (%s)" % (c.unicode_repr, c.name, unicode_to_hex(c.unicode_repr)))
    except ValueError as exc:
        print_error(str(exc))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号