本文整理汇总了Python中unicodedata.ucd_3_2_0.category函数的典型用法代码示例。如果您正苦于以下问题:Python category函数的具体用法?Python category怎么用?Python category使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了category函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: in_table_c22
def in_table_c22(code):
c = ord(code)
if c < 128:
return False
if unicodedata.category(code) == 'Cc':
return True
return c in c22_specials
示例2: in_table_a1
def in_table_a1(code):
if unicodedata.category(code) != 'Cn':
return False
c = ord(code)
if 64976 <= c < 65008:
return False
return c & 65535 not in (65534, 65535)
示例3: in_table_a1
def in_table_a1(code):
if unicodedata.category(code) != "Cn":
return False
c = ord(code)
if 0xFDD0 <= c < 0xFDF0:
return False
return (c & 0xFFFF) not in (0xFFFE, 0xFFFF)
示例4: in_table_c5
def in_table_c5(code):
return unicodedata.category(code) == "Cs"
示例5: in_table_c21_c22
def in_table_c21_c22(code):
return unicodedata.category(code) == "Cc" or \
ord(code) in c22_specials
示例6: in_table_c21
def in_table_c21(code):
return ord(code) < 128 and unicodedata.category(code) == "Cc"
示例7: in_table_c11_c12
def in_table_c11_c12(code):
return unicodedata.category(code) == "Zs"
示例8: in_table_c3
def in_table_c3(code):
return unicodedata.category(code) == 'Co'
示例9: in_table_c21_c22
def in_table_c21_c22(code):
return unicodedata.category(code) == 'Cc' or ord(code) in c22_specials
示例10: in_table_c12
def in_table_c12(code):
return unicodedata.category(code) == 'Zs' and code != u' '
示例11: gen_category
def gen_category(cats):
for i in range(0, 0x110000):
if unicodedata.category(chr(i)) in cats:
yield(i)