crosseno / lexicon-index
Pure-PHP, checksummed solver indexes for Crosseno language packs.
Requires
- php: ^8.5
- crosseno/core: ^0.1
- crosseno/lexicon: ^0.1
Requires (Dev)
- crosseno/compiler: ^0.1
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^12.5
README
Pure-PHP, checksummed solver indexes for Crosseno language packs.
The package implements SolverIndexInterface for Crosseno's backtracking hot loop. It reads immutable solver.idx artifacts through lazily decoded length buckets and writes deterministic artifacts during language-pack compilation. It has no PDO dependency.
composer require crosseno/lexicon-index
use Crosseno\LexiconIndex\BinarySolverIndex; $index = new BinarySolverIndex(__DIR__ . '/resources/solver.idx'); $candidates = $index->candidates($query); $ordinalKeys = $index->answerKeysByOrdinal();
Language-pack build tooling registers Crosseno\LexiconIndex\Compilation\CompilerIndexArtifactWriter as an additional crosseno/compiler artifact writer. Compiler classes are intentionally a development dependency; runtime consumers only construct BinarySolverIndex.
answerKeysByOrdinal() exposes the validated global stable-key order used by compatible learning masks and builder pack descriptors. Ordinary applications should obtain it through a runtime language pack rather than opening the index directly.
The complete V1 wire format and resource limits are specified in docs/architecture.md. Checksums detect accidental or malicious corruption but do not authenticate a publisher; verify signed releases or trusted package-manager checksums separately.