Ignore:
Timestamp:
Oct 6, 2017, 1:22:53 PM (2 years ago)
Author:
cameron
Message:

Case folding property objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/UCD-scripts/casefold.py

    r5672 r5673  
    1313import UCD_config
    1414from unicode_set import *
    15 from UCD_parser import parse_CaseFolding_txt
     15from UCD_parser import parse_PropertyAlias_txt, parse_CaseFolding_txt
    1616
    1717def simple_CaseFolding_BitSets(fold_map):
     
    4040def simple_CaseClosure_map(fold_data):
    4141   simpleFoldMap = {}
    42    for k in fold_data['S'].keys(): simpleFoldMap[k] = fold_data['S'][k]
    43    for k in fold_data['C'].keys(): simpleFoldMap[k] = fold_data['C'][k]
     42   for k in fold_data['S'].keys(): simpleFoldMap[k] = int(fold_data['S'][k], 16)
     43   for k in fold_data['C'].keys(): simpleFoldMap[k] = int(fold_data['C'][k], 16)
    4444   cl_map = {}
    4545   for k in simpleFoldMap.keys():
     
    151151
    152152def genCaseFolding_txt_h():
    153    fold_data = parse_CaseFolding_txt()
    154    cm = simple_CaseClosure_map(fold_data)
    155    f = cformat.open_header_file_for_write('CaseFolding_txt', 'casefold.py')
    156    cformat.write_imports(f, ["<vector>", '"re/re_cc.h"'])
    157    f.write(foldDeclarations)
    158    f.write(genFoldEntryData(cm))
    159    cformat.close_header_file(f)
     153    (property_enum_name_list, property_object_map) = parse_PropertyAlias_txt()
     154    fold_data = parse_CaseFolding_txt(property_object_map)
     155    cm = simple_CaseClosure_map(fold_data)
     156    f = cformat.open_header_file_for_write('CaseFolding_txt', 'casefold.py')
     157    cformat.write_imports(f, ["<vector>", '"re/re_cc.h"'])
     158    f.write(foldDeclarations)
     159    f.write(genFoldEntryData(cm))
     160    #emit_property(f, 'scf')
     161    #emit_property(f, 'cf')
     162    cformat.close_header_file(f)
    160163
    161164if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.