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
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)
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)
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)
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
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
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
def in_table_c5(code): return unicodedata.category(code) == "Cs"
def in_table_c21(code): return ord(code) < 128 and unicodedata.category(code) == "Cc"
def in_table_c21_c22(code): return unicodedata.category(code) == "Cc" or \ ord(code) in c22_specials
def in_table_c3(code): return unicodedata.category(code) == 'Co'
def in_table_c11_c12(code): return unicodedata.category(code) == "Zs"
def gen_category(cats): for i in range(0, 0x110000): if unicodedata.category(chr(i)) in cats: yield(i)
def in_table_c21_c22(code): return unicodedata.category(code) == 'Cc' or ord(code) in c22_specials
def in_table_c12(code): return unicodedata.category(code) == 'Zs' and code != u' '
def gen_category(cats): for i in range(0, 0x110000): if unicodedata.category(chr(i)) in cats: yield (i)