報せNews
2026-09-07 報 release. 7 September 2026
The sweep index reaches Ruby in kotoshu 0.9.2
Per-word sweep invariants now live in a lazily memoized per-dictionary index, which gives 2.2x on the English average and up to 6x on short words, with byte-identical outputs.
- This release is the twin of the wasm 0.3.2 release: Kotoshu::Suggestions::SweepIndex memoizes character lengths, Soundex codes, and length buckets on the dictionary, built at the first sweep. The edit-distance strategy draws its length window from the buckets with word-list order restored so ranking tie order is untouched, the phonetic strategy compares memoized codes, and the n-gram gate reads indexed lengths; the strategies also stop copying the whole word list per sweep.
- Warm benchmarks on full cached dictionaries under MRI 3.4.8 show the English average dropping from 1,472 to 661 ms per suggest (2.2x), the Spanish average from 2,591 to 1,396 ms (1.9x), and short words gaining up to 6.2x, with Teh at 185 ms, wrold at 656 ms, and gatoss at 1,249 ms. Mutation safety is explicit: every add_word, remove_word, clear, and merge path resets the memo, pinned by specs on real Hunspell and PlainText dictionaries.
- Outputs byte-identical across 14 en+es combinations; the 2,630 conformance vectors untouched and replay green; suite 3,795 examples, 0 failures; rubocop clean over 447 files. Soundex now lives once in Algorithms::Soundex, shared by strategy and index.