Commit 05050b4
committed
fix: preserve proper noun case in user dictionary (#72)
Fixed issue where user-added words like "Boston" were stored with original
case but displayed/predicted as lowercase.
Root cause: loadCustomAndUserWords() called .lowercase() on words when
loading into dictionary, losing the original case.
Fix:
- Added userWordOriginalCase map to track original case of user words
- Populate map when loading custom words (if word has uppercase)
- Apply original case to predictions via applyUserWordCase()
- Added helper methods applyUserWordCase() and applyUserWordCaseToList()
- Clear map on reload to prevent stale entries
Also added:
- preserveCapitalization() helper for autocorrect case preservation
- isIntentionallyCapitalized() to detect mid-sentence proper nouns
— claude-opus-4-5-202511011 parent 29dd10e commit 05050b4
2 files changed
Lines changed: 86 additions & 6 deletions
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
104 | 147 | | |
105 | 148 | | |
106 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| 246 | + | |
| 247 | + | |
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
| |||
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
357 | 385 | | |
358 | 386 | | |
359 | 387 | | |
| |||
1212 | 1240 | | |
1213 | 1241 | | |
1214 | 1242 | | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
1219 | 1253 | | |
1220 | 1254 | | |
1221 | 1255 | | |
| |||
1453 | 1487 | | |
1454 | 1488 | | |
1455 | 1489 | | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
1456 | 1493 | | |
1457 | | - | |
| 1494 | + | |
1458 | 1495 | | |
1459 | 1496 | | |
1460 | 1497 | | |
1461 | | - | |
| 1498 | + | |
1462 | 1499 | | |
1463 | 1500 | | |
1464 | 1501 | | |
| |||
0 commit comments