libscid snapshot+b450b7969924
Chess applications made easy.
Source on GitHub License GPL v2
Loading...
Searching...
No Matches
Spell Checker

Spell checker is the loaded spelling-file index. SpellChecker::create() reads the file, builds canonical-name tables and sorted alias indexes for each database nameT, and owns the strings returned by lookup.

The lookup contract is deliberately simple. find() removes the comparison characters configured by the current spelling section, searches the sorted alias index, and returns unique canonical names up to the requested limit. An exact alias wins over prefix matches. Player lookup adds Scid's surname-last convenience rule when the first lookup finds nothing.

Domain Model

The public object is intentionally immutable after loading. The private loader is stateful while it reads the file: it tracks the current name section and the current canonical name so that aliases, normalisation rules, biography lines and Elo rows attach to the right table. Once loading succeeds, SpellChecker is a read-only query object.

Returned names are borrowed pointers into the spell checker. The same lifetime rule applies to getGeneralCorrections(), getPlayerInfo() and getPlayerElo(): keep the spell checker alive while using returned views.