mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-13 09:14:12 +00:00
Support enabling the CSUR data.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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__':
|
||||
|
||||
@@ -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
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user