Skip to content

Commit 5a16fb8

Browse files
committed
More tags
1 parent 088e33f commit 5a16fb8

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

bin/ucd_to_json.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,74 @@ async function main() {
8585
tags.push('Dash');
8686
}
8787

88+
switch (charData.nt) {
89+
case 'De':
90+
tags.push('Decimal');
91+
break;
92+
case 'Di':
93+
tags.push('Digit');
94+
break;
95+
case 'Nu':
96+
tags.push('Numeric');
97+
break;
98+
}
99+
100+
if (charData.Upper === 'Y') {
101+
tags.push('Uppercase');
102+
}
103+
if (charData.Lower === 'Y') {
104+
tags.push('Lowercase');
105+
}
106+
if (charData.OUpper === "Y") {
107+
tags.push("Other_Uppercase");
108+
}
109+
if (charData.Lower === "Y") {
110+
tags.push("Other_Lowercase");
111+
}
112+
113+
if (charData.Term === 'Y') {
114+
tags.push('Terminal_Punctuation');
115+
}
116+
if (charData.STerm === 'Y') {
117+
tags.push('Sentence_Terminal');
118+
}
119+
if (charData.Dia === 'Y') {
120+
tags.push('Diacritic');
121+
}
122+
if (charData.Ext === 'Y') {
123+
tags.push('Extender');
124+
}
125+
if (charData.SD === 'Y') {
126+
tags.push('Soft_Dotted');
127+
}
128+
if (charData.Alpha === 'Y') {
129+
tags.push('Alphabetic');
130+
}
131+
if (charData.OAlpha === 'Y') {
132+
tags.push('Other_Alphabetic');
133+
}
134+
if (charData.Math === 'Y') {
135+
tags.push('Math');
136+
}
137+
if (charData.OMath === 'Y') {
138+
tags.push('Other_Math');
139+
}
140+
if (charData.Hex === 'Y') {
141+
tags.push('Hexadecimal');
142+
}
143+
if (charData.AHex === 'Y') {
144+
tags.push('ASCII_Hexadecimal');
145+
}
146+
if (charData.RI === 'Y') {
147+
tags.push('Regional_Indicator');
148+
}
149+
if (charData.NChar === 'Y') {
150+
tags.push('Noncharacter_Code_Point');
151+
}
152+
if (charData.VS === 'Y') {
153+
tags.push('Variation_Selector');
154+
}
155+
88156
var name = charData.na || charData.na1;
89157
if (!name && charData['name-alias']) {
90158
name = charData['name-alias'][0].alias;

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function fmtTags(cell: CellComponent) {
238238
var el = document.createElement("span");
239239
el.className =
240240
"badge border border-primary text-primary me-1 mb-1 text-decoration-none";
241-
el.textContent = key;
241+
el.textContent = key.replace(/_/g, " ");
242242
el.style.cursor = "pointer";
243243
el.onclick = (e) => {
244244
e.preventDefault();
@@ -362,7 +362,7 @@ function toggleTagFilter(cell: CellComponent, tag: string): void {
362362
function toggleTagArray(tags: string[], tag: string): string[] {
363363
var idx = tags.indexOf(tag);
364364
if (idx != -1) {
365-
tags.splice(idx);
365+
tags.splice(idx, 1);
366366
//tags.push(`!${tag}`);
367367
return tags;
368368
}

0 commit comments

Comments
 (0)