예제 #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'