Skip to content

Commit 96ae3f2

Browse files
committed
Canonicalize binary property aliases such as STerm
Assisted-By: GPT-6
1 parent c571fbf commit 96ae3f2

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎scripts/parse-blocks-scripts-properties.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ const parseBlocksScriptsProperties = async (type, version) => {
9090
if (!item) {
9191
throw new Error(`Canonical script name not found in ${line}.`);
9292
}
93+
} else {
94+
item = findCanonicalName(item);
9395
}
9496
map[item] ??= regenerate();
9597
const rangeParts = charRange.split('-');

‎tests/parsers.mjs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ test('Hangul has pairwise canonical decomposition mappings', async (t) => {
1919
t.assert.equal(await parseDecompositionMapping('1.1.5'), undefined);
2020
});
2121

22+
test('Binary property aliases use canonical names', async (t) => {
23+
for (const version of ['4.0.1', '4.1.0', '5.0.0', '6.3.0', '8.0.0', '18.0.0']) {
24+
const properties = await parseProperties(version);
25+
t.assert.ok(properties.Sentence_Terminal.contains(0x21));
26+
t.assert.equal(properties.STerm, undefined);
27+
}
28+
});
29+
2230
test('Historical Script values use canonical names', async (t) => {
2331
for (const version of ['3.1.0', '3.1.1', '3.2.0', '4.0.0']) {
2432
const scripts = await parseScripts(version);

0 commit comments

Comments
 (0)