示例#1
0
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
0
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)
示例#3
0
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)
示例#4
0
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)
示例#5
0
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
示例#6
0
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)
示例#7
0
def in_table_c22(code):
    c = ord(code)
    if c < 128:
        return False
    elif unicodedata.category(code) == 'Cc':
        return True
    else:
        return c in c22_specials
示例#8
0
def alphabet():
    u = ''.join(
        chr(i) for i in range(65536)
        if (ud.category(chr(i)) in ('Lu', 'Ll')))[:1000]
    # ('Lu', 'Ll', 'Lt', 'Lm', 'Lo' )
    # u = ''.join(chr(i) for i in range(65536) if (ud.category(chr(i)) in ('Lu', 'Ll', 'Lt', 'Lm', 'Lo')))
    alphabet_size = len(u)
    decoderdict = dict((b, a) for a, b in enumerate(u))
    return u, alphabet_size, decoderdict
示例#9
0
def in_table_c5(code):
    return unicodedata.category(code) == "Cs"
示例#10
0
def in_table_c21(code):
    return ord(code) < 128 and unicodedata.category(code) == "Cc"
示例#11
0
def in_table_c21_c22(code):
    return unicodedata.category(code) == "Cc" or \
           ord(code) in c22_specials
示例#12
0
def in_table_c3(code):
    return unicodedata.category(code) == 'Co'
示例#13
0
def in_table_c11_c12(code):
    return unicodedata.category(code) == "Zs"
示例#14
0
def gen_category(cats):
    for i in range(0, 0x110000):
        if unicodedata.category(chr(i)) in cats:
            yield(i)
示例#15
0
def in_table_c21_c22(code):
    return unicodedata.category(code) == 'Cc' or ord(code) in c22_specials
示例#16
0
def in_table_c12(code):
    return unicodedata.category(code) == 'Zs' and code != u' '
示例#17
0
def gen_category(cats):
    for i in range(0, 0x110000):
        if unicodedata.category(chr(i)) in cats:
            yield (i)
示例#18
0
def in_table_c12(code):
    return unicodedata.category(code) == 'Zs' and code != u' '
示例#19
0
def in_table_c21_c22(code):
    return unicodedata.category(code) == 'Cc' or ord(code) in c22_specials
示例#20
0
def in_table_c3(code):
    return unicodedata.category(code) == 'Co'