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

Book is the exact-position ECO classifier. Book::load() reads a Scid ECO text file, parses each line from the standard starting position, and stores the final compact board together with the ECO code, opening name and move text.

Lookup is intentionally exact. findEcoString() and findEco() use the candidate position's hash to find a small bucket and then compare the compact board string. A transposition or nearby opening prefix is not enough; the board must match one of the positions loaded from the ECO file.

Domain Model

The book stores two views of the same ECO source. For classification, it keeps an index from position hash to compact board plus comment text. For browsing, it keeps the loaded comments in file order so linesWithPrefix() can return Book::Line rows without reconstructing them from positions.

Returned strings are borrowed from the Book. A Book::Line is a display row with code, name and moves views; the findEcoString() result is a single view in the form C50a [Italian Game]; findEco() returns the packed Code or ECO_None.