Language-neutral clue selection, validation, and deterministic assignment for Crosseno crosswords.
The package provides bounded clue lookup, validation, scoring, selection, and post-placement assignment.
composer require crosseno/cluesPublished releases resolve crosseno/core and crosseno/lexicon through tagged ^0.1 constraints. Source-level CI injects checked-out siblings through Composer's global root configuration; the published manifest contains no path repositories.
use Crosseno\Clues\Assignment\ClueAssignmentConstraints;
use Crosseno\Clues\Assignment\ClueSeed;
use Crosseno\Lexicon\Language\LanguageCode;
$result = $assigner->assign(
$generatedCrossword,
$clueCatalog,
new ClueAssignmentConstraints(new LanguageCode('en'), targetDifficulty: 50),
new ClueSeed('publication-2026-07-17'),
);Catalogs implement ClueProviderInterface and return bounded results for a sense, language policy, and allowed types. The assigner validates every candidate, ranks valid clues with integer scores, uses a versioned SHA-256 tie order, prevents repeated IDs/text, then validates the complete set.
A runtime language pack's storage-neutral lexical catalog can be adapted directly:
use Crosseno\Clues\Catalog\LexicalCatalogClueProvider;
$provider = new LexicalCatalogClueProvider(
$runtimePack->catalog(),
$runtimePack->metadata()->stableKeyAlgorithmVersion,
);The adapter requires a stable sense-key query, applies the requested language-matching policy and type filter, preserves stable IDs, bounds results, and returns clue-ID order. Catalog records with missing required difficulty or unsupported domain data fail explicitly. See catalog provider.
Clue text is plain UTF-8 text. HTML is never trusted or interpreted by this package; renderers must escape it for their output context. Construction and assignment policies independently enforce byte and Unicode-code-point limits.
Leakage policy explicitly chooses display text, normalized tokens, lemmas, or supplied inflected forms, plus whole-token or substring matching. Normalization and lexical equivalence come from crosseno/lexicon interfaces through LanguageServiceProviderInterface. Missing services and missing sense mappings have explicit fail-closed or opt-out policies.
The standard validators cover answer leakage, same-root leakage, unsupported/ambiguous senses, language mismatch, length, difficulty, duplicates, missing clues, and set-level difficulty balance.
Assignment runs only after placement. The package does not query clue text in generator search, render HTML, depend on a concrete language pack, expose SQLite records, or provide CMS container/routing configuration.
Ordinary applications normally receive the standard assigner through crosseno/builder; direct use remains available for custom policy. The English executable proof is crosseno/builder/examples/generate-english.php.