diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-05-19 00:50:09 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-05-19 00:50:09 +0200 |
commit | d6b1db5c14ca1e731db299748d2df9eb955c9f7c (patch) | |
tree | f35522863ce32244454dd1ba77fd3c7003395cdb /gen/prop/bool-props.py | |
parent | 40e7a4384bcead4db0559b30a46d4bfb0fbf3049 (diff) |
Add uprop_is_ce() and uprop_is_comp_ex()
Diffstat (limited to 'gen/prop/bool-props.py')
-rwxr-xr-x | gen/prop/bool-props.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gen/prop/bool-props.py b/gen/prop/bool-props.py index 62cfe74..5ac0287 100755 --- a/gen/prop/bool-props.py +++ b/gen/prop/bool-props.py @@ -8,17 +8,29 @@ from lib import * def parse(file: str) -> list[bool]: xs = [False] * 0x110000 - if sys.argv[1] == 'Indic_Conjunct_Break': - sys.argv[1] = 'InCB;' + + sys.argv[1] = ({ + 'Composition_Exclusion': '', + 'Indic_Conjunct_Break': 'InCB;', + }).get(sys.argv[1], sys.argv[1]) + with open(file, 'r') as f: for line in f.readlines(): if ( - len(line) == 0 + len(line.strip()) == 0 or line[0] == '#' or sys.argv[1] not in line ): continue - parts = [int(x, 16) for x in line.split(';')[0].strip().split('..')] + parts = [ + int(x, 16) for x in ( + line + .split('#')[0] + .split(';')[0] + .strip() + .split('..') + ) + ] for i in range(parts[0], parts[len(parts) - 1] + 1): xs[i] = True return xs |