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

Case folding property objects

File:
1 edited

Legend:

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

    r5672 r5673  
    427427# There may be multiple entries per codepoint
    428428
    429 def parse_CaseFolding_txt():
     429def parse_CaseFolding_txt(property_object_map):
    430430    fold_map = {}
    431431    f = open(UCD_config.UCD_src_dir + "/" + 'CaseFolding.txt')
     
    438438        if fold_type == 'S' or fold_type == 'C':
    439439            # fold value is guaranteed to be a single codepoint
    440             fold_val = int(fold_val, 16)
     440            property_object_map['scf'].addDataRecord(cp, cp, fold_val)
    441441        else:
    442             fold_val = [int(x, 16) for x in fold_val.split(" ")]
     442            if fold_type == 'F':
     443                property_object_map['cf'].addDataRecord(cp, cp, fold_val)
    443444        fold_map[fold_type][cp] = fold_val
     445    property_object_map['scf'].finalizeProperty()
     446    property_object_map['cf'].finalizeProperty()
    444447    return fold_map
    445448
Note: See TracChangeset for help on using the changeset viewer.