Hebrew: auto-prune lingering learned typos (אנט→אני) — v2.5.5 - #69
Merged
Conversation
…(אנט→אני) The engine already corrects אנט→אני (one adjacent-key slip, אני freq ~4.5M), but if אנט was saved to "my words" by the old over-eager learning it counts as a known word and is never corrected. The existing prune only dropped learned words the dictionary already contains; a genuine non-word typo like אנט survived. Extend the load-time prune (Hebrew only) to also drop a learned, non-dictionary word that is one transposition/adjacent-key slip from a *common* dictionary word (freq ≥ 50k). Conservative: a word with no cheap fix to a common word stays — e.g. מאציו (its only cheap neighbour is rare) is left for the confusion map, and real words are never touched. A word you truly want is re-learned by retyping it. English is unaffected (its far larger counts would over-match); it stays covered by the interactive "replace + forget" bar chip. Pinned in a corpus test. 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.
The bug
אנטdoesn't autocorrect toאני. But the engine already handles it —bestCorrection("אנט")returnsאניat cost 1 (adjacent-key slipט→י;אניis freq ~4.5M). The real cause:אנטis saved in "my words", so it counts as a known word and is never corrected — leftover pollution from the old over-eager learning (fixed in 2.3.5).The 2.3.6 auto-prune only dropped learned words the dictionary already contains; a genuine non-word typo like
אנטsurvived it.The fix
Extend the load-time prune (Hebrew only) to also drop a learned, non-dictionary word that is one transposition/adjacent-key slip from a common dictionary word (freq ≥ 50k). So
אנטself-heals on the next launch and autocorrects toאניagain.Conservative — validated against the real dictionary:
אנט→ pruned (→אני, cost 1, freq 4.5M) ✓מאציו→ kept (its only cheap neighbour is rare — left for the confusion map, not mis-pruned) ✓כלב) → kept ✓A word you truly want is re-learned by retyping it. English is unaffected (its far larger frequency counts would over-match) and stays covered by the interactive "replace + forget" bar chip from 2.3.6. Pinned in a corpus test.
Version → 2.5.5 (rebased onto current main; note main had advanced to 2.5.4 with your recent work).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Unbc3zuLA7kfCnaBL4pCHF
Generated by Claude Code