Support enabling the CSUR data.

This commit is contained in:
Reece H. Dunn
2014-11-08 11:11:19 +00:00
parent 4bfa9e5cf6
commit bcf8be59b3
6 changed files with 45 additions and 5 deletions
+5
View File
@@ -28,6 +28,11 @@ unicode_chars = {}
for data in ucd.parse_ucd_data(ucd_rootdir, 'UnicodeData'):
for codepoint in data['CodePoint']:
unicode_chars[codepoint] = data['GeneralCategory']
if '--with-csur' in sys.argv:
for csur in ['Klingon']:
for data in ucd.parse_ucd_data('data/csur', csur):
for codepoint in data['CodePoint']:
unicode_chars[codepoint] = data['GeneralCategory']
# This map is a combination of the information in the UnicodeData and Blocks
# data files. It is intended to reduce the number of character tables that
+10
View File
@@ -22,6 +22,7 @@ import sys
import ucd
ucd_rootdir = sys.argv[1]
csur_rootdir = 'data/csur'
unicode_chars = {}
for data in ucd.parse_ucd_data(ucd_rootdir, 'UnicodeData'):
@@ -35,6 +36,15 @@ for data in ucd.parse_ucd_data(ucd_rootdir, 'PropList'):
for data in ucd.parse_ucd_data(ucd_rootdir, 'Scripts'):
for codepoint in data['Range']:
unicode_chars[codepoint]['Script'] = data['Script']
if '--with-csur' in sys.argv:
for csur in ['Klingon']:
for data in ucd.parse_ucd_data('data/csur', csur):
for codepoint in data['CodePoint']:
if not 'TitleCase' in data: data['TitleCase'] = codepoint
if not 'UpperCase' in data: data['UpperCase'] = codepoint
if not 'LowerCase' in data: data['LowerCase'] = codepoint
if not 'Properties' in data: data['Properties'] = []
unicode_chars[codepoint] = data
null = ucd.CodePoint('0000')
if __name__ == '__main__':
+5
View File
@@ -28,6 +28,11 @@ unicode_chars = {}
for data in ucd.parse_ucd_data(ucd_rootdir, 'Scripts'):
for codepoint in data['Range']:
unicode_chars[codepoint] = data['Script']
if '--with-csur' in sys.argv:
for csur in ['Klingon']:
for data in ucd.parse_ucd_data('data/csur', csur):
for codepoint in data['CodePoint']:
unicode_chars[codepoint] = data['Script']
# This map is a combination of the information in the UnicodeData and Blocks
# data files. It is intended to reduce the number of character tables that
+2 -1
View File
@@ -98,6 +98,7 @@ def strlist(x):
return x, []
data_items = {
# Unicode Character Data:
'Blocks': [
('Range', codepoint),
('Name', string)
@@ -137,7 +138,7 @@ data_items = {
('LowerCase', codepoint),
('TitleCase', codepoint),
],
# Supplemental Data:
# ConScript Unicode Registry Data:
'Klingon': [
('CodePoint', codepoint),
('Script', string),