Autocorrect: learned words no longer hijack corrections; add סגטק→סגור — v2.5.7 - #71
Merged
Merged
Conversation
…→סגור Two fixes for "Hebrew autocorrect feels off" + typos piling up in "my words": 1. A learned word (weight = count × 50k) was a valid correction TARGET, so a typo that slipped into "my words" could outrank real words — many Hebrew words are far less frequent than 50k (e.g. סגור ≈ 10.8k) — and hijack corrections, pulling real words toward the typo. Now isDictWord is base-dictionary only: corrections only ever land on a real listed word. Learned words are still left alone (isWord unchanged), just never a target. This also stops a typo in "my words" from corrupting other words' corrections. 2. Add the curated override סגטק→סגור (ט→ו and ק→ר, both adjacent-key slips — two edits, which the edit-1 corrector can't reach; a blanket 2-edit corrector is ~21% wrong on the real dictionary, so a curated entry is the safe fix). Existing pinned cases still pass; a learned typo can no longer win as a target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Unbc3zuLA7kfCnaBL4pCHF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why "Hebrew autocorrect feels off"
Two linked problems, both traced empirically:
1. Typos in "my words" were hijacking corrections (the big one)
A learned word is a correction target with weight
count × 50,000. Many real Hebrew words are far less frequent than that (e.g.סגור≈ 10,800), so a typo that slipped into "my words" could outrank real words and pull corrections toward itself. As "my words" fills with mistakes, this gets worse — exactly the "feels off" you described.Fix:
isDictWord(the "correct-to" gate) is now base-dictionary only. Corrections only ever land on a real listed word. Learned words are still left alone (never autocorrected away —isWordunchanged), they just can't be a target anymore. A typo in "my words" can no longer corrupt other words' corrections.2.
סגטק → סגורwasn't correctedIt's two adjacent-key slips (
ט→ו,ק→ר) — edit distance 2, which the edit-1 corrector can't reach. I measured a blanket 2-edit corrector against the real dictionary: ~21% wrong (picks a different common word), too erratic to auto-apply. So this is a curated confusion entry, the safe fix — same asמאציו→מאמין.What you should do on-device
Your "my words" has accumulated mistakes from older versions. Once on 2.5.7, open My words and use "Clear all" to wipe the pollution — going forward, learning stays conservative and the auto-prune keeps it clean. (After clearing,
סגטקwill correct toסגור, since it's no longer a learned word.)Pinned cases still pass (
מאציו,נרעה,צה→מה,אנט→אני,teh,wich), plus the newסגטק→סגור.Version → 2.5.7. Holding merge until CI confirms the build.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Unbc3zuLA7kfCnaBL4pCHF
Generated by Claude Code