Publish as versioned Gitea module; move dictionary pipeline out
- Rename module to gitea.iliadenisov.ru/developer/scrabble-solver so it can be consumed as a versioned dependency (no go.work replace / CI clone). - De-internalize wordlist and dictdawg as public packages. - Remove cmd/builddict, dictprep/, the dictionaries submodule and the dawg Makefile: the word-list parsing and DAWG build now live in the separate scrabble-dictionary repository, which publishes the DAWG set as a release artifact. - internal/dict loads the committed dawg/en_sowpods.dawg fixture for cmd/stress. - Update README/CLAUDE docs accordingly.
This commit is contained in:
@@ -24,27 +24,24 @@ See [`ALGORITHM.md`](ALGORITHM.md) for the algorithm (the single source of truth
|
||||
```
|
||||
scrabble/ public API: Solver, Move/Play types, DAWG generator, scoring, validation
|
||||
board/ rack/ rules/ board grid (+transpose), rack, rulesets (English/Russian/Эрудит)
|
||||
internal/ encoding (byte conventions), wordlist, dictdawg, dict, graph
|
||||
cmd/builddict/ word list -> serialized DAWG in testdata
|
||||
wordlist/ dictdawg/ public word-list parsing and DAWG build/load helpers
|
||||
internal/ encoding (byte conventions), dict (committed-DAWG loader), graph
|
||||
cmd/stress/ greedy self-play benchmark of the generator
|
||||
selfplay/ bag + greedy player + game loop
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
```sh
|
||||
git submodule update --init # the dictionaries submodule (SOWPODS, TWL06, …)
|
||||
go run ./cmd/builddict # build testdata/sowpods.dawg (≈0.2 s, ~730 KB)
|
||||
```
|
||||
|
||||
`go.mod` carries `replace github.com/iliadenisov/dafsa => ../dafsa`: the solver needs
|
||||
dafsa's low-level traversal `Cursor` (see the patch notes in `../dafsa/SCRABBLE_API.md`).
|
||||
The committed dictionary DAWGs under `dawg/` (`en_sowpods`, `ru_scrabble`, `ru_erudit`)
|
||||
are used directly — no build step. The word-list parsing and DAWG build pipeline lives in
|
||||
the separate [`scrabble-dictionary`](https://gitea.iliadenisov.ru/developer/scrabble-dictionary)
|
||||
repository, which publishes the DAWG set as a release artifact.
|
||||
|
||||
## Usage
|
||||
|
||||
```go
|
||||
rs := rules.English()
|
||||
finder, _ := dict.EnglishDAWG() // loads testdata/sowpods.dawg
|
||||
finder, _ := dict.EnglishDAWG() // loads dawg/en_sowpods.dawg
|
||||
s := scrabble.NewSolver(rs, finder)
|
||||
|
||||
b := board.New(rs.Rows, rs.Cols) // empty board (first move)
|
||||
|
||||
Reference in New Issue
Block a user