mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-08 13:00:18 +00:00
c19b1cae73bfd7dd78609f5ba4795795e77ae64c
Czech's dictionary-driven ranking (case, MAP, REP, missing spaces, KEY, TRY edits, a stem scan) had five older copies. Polish, Portuguese, Croatian, Italian and Russian each kept one: 300 to 400 lines of the same rounds with a few lines of language knowledge mixed in. Fixes reached some copies only. NOSUGGEST (storytold/wordcraft#1048) and the first-difference tie-break (storytold/wordcraft#797) never got to all of them, and none had the KEY round or the bound on TRY letters. affix_suggest.rs is that ranking once. A language's `Tuning` holds what is its own: the short words that run into their neighbours (Polish, Portuguese, Croatian, Italian), Russian's split rule, the letter groups and confusions its dictionaries lack (Croatian, Russian), letters to try for a dictionary without a TRY line, and cost hooks for Polish final devoicing and Russian е/ё. Czech, Indonesian and Spanish use the dictionary's tables alone. Turkish keeps its own suggester, which reads another dictionary type with rounds of its own. The language tables add to the dictionary's instead of replacing them, and TRY letters are tried in the dictionary's order, commonest first, as the copies did (the Czech engine sorted them). Old and new compared on the test dictionaries, with every one-letter typo of each word plus the tests' misspellings, top eight suggestions: Czech, Croatian, Italian and Portuguese give the same for all 7,903 inputs. Polish differs for 44 of 3,244 and Russian for 33 of 2,346, all orderings among candidates of equal cost, from the tie-break they now share (`ie` → `nie` before `i`). New tests pin the moved knowledge: the tuning mechanism, Croatian's groups without MAP lines, and Russian's costs and split rule. Turning each knob off fails one. Proof: 283 tests.
Languages
Rust
98.5%
Max
1.3%
Python
0.2%