Commit e4fba74
committed
Streamline character variants to one canonical form for reproducible JSON
The scrub decomposed some things (superscripts to digits) but left
typographic and symbol variants untouched, so the character set the
downstream LLM converts to JSON was inconsistent -- e.g. "datatype
folder(s) -> modality folder(s)" kept a unicode arrow while everything
around it was ASCII. Inconsistent input makes the LLM's JSON output
non-reproducible.
_normalize_chars collapses each variant family to a single form:
- curly quotes -> straight, en/em/minus dashes -> "-", ellipsis -> "...",
unicode spaces -> space, arrows -> "->"/"<-";
- box-drawing and block characters are dropped -- they are the model
rendering a folder tree as |-- lines, structure not content;
- NFKC folds remaining compatibility duplicates (micro sign U+00B5 vs
greek mu U+03BC, any unicode super/subscript digits) to one encoding.
Real content is preserved: verified 124 Hebrew characters survive on
8228476, and Greek, accented Latin (Argudin, Munz-Manor) and units
(degree, euro, micro, multiplication, >=) are left intact. The step is
metric-neutral by construction -- the scorer already strips non-
alphanumerics, so rField/rGlobal are unchanged at 0.784/0.816 -- its
value is a clean, uniform character set for the LLM->JSON stage.1 parent 01d73f2 commit e4fba74
2 files changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
73 | 100 | | |
74 | 101 | | |
75 | 102 | | |
| |||
112 | 139 | | |
113 | 140 | | |
114 | 141 | | |
| 142 | + | |
115 | 143 | | |
116 | 144 | | |
117 | 145 | | |
| |||
0 commit comments