報せNews
2026-09-07 報 release. 7 September 2026
The sweep fix reaches Ruby in kotoshu 0.9.1
Pure-Ruby suggestions drop from tens of seconds to under a second on full dictionaries, and the Damerau sweep ships for gem users, so Teh suggests The in first place.
- The patch release carries both suggestion-quality changes for gem users. The Damerau edit sweep charges transpositions one step, enumerates substitutions and insertions over the aff TRY string, and validates forms through affix-aware lookup, which puts Teh to The and definately to definitely in first place. The sweep-performance port builds one word index per generate instead of scanning the dictionary per keyboard variant, adds a length pre-gate ahead of the n-gram scan, computes Jaccard in one pass without the intermediate key-union array, and builds Soundex in reused buffers.
- Benchmarked on full en_US (48,262 words, MRI 3.4.8, pure-Ruby backend): Teh 20.6 s to 0.59 s, mispellings 140.2 s to 0.75 s, recieve 36.2 s to 0.70 s, definately 55.7 s to 0.87 s, asdfghjkl 39.6 s to 0.86 s. Suggestion outputs are byte-identical — the 2,630 conformance vectors are untouched, and equivalence fuzz against the old algorithms (6,004 find-word inputs, 22,011 soundex inputs, 2,986 similarity pairs) found zero mismatches.
- The dictionary data files that had ridden along under docs/verification-evidence are no longer packaged — the gem is 269 library files, no stray hunspell data. Suite 3,777 examples, 0 failures; rubocop clean.
see also kotoshu on RubyGems gem PR #146 — the Damerau sweep gem PR #147 — the indexed sweep