build_tools.syllable_walk_tui.services.selector_runner
Name selector execution service.
Mirrors the CLI behavior of build_tools.name_selector.
Classes
Result from selector execution. |
Functions
|
Run name_selector for a patch (mirrors CLI behavior exactly). |
Module Contents
- class build_tools.syllable_walk_tui.services.selector_runner.SelectorResult[source]
Result from selector execution.
- output_path: pathlib.Path
- build_tools.syllable_walk_tui.services.selector_runner.run_selector(patch, combiner_state, selector_state)[source]
Run name_selector for a patch (mirrors CLI behavior exactly).
- This function mirrors the CLI:
- python -m build_tools.name_selector
–run-dir <patch.corpus_dir> –candidates <from combiner output> –name-class <name_class> –count <count> –mode <mode>
Output is written to: <run-dir>/selections/{prefix}_{name_class}_{N}syl.json
- TUI Extension:
When combiner_state.syllable_mode == “all”: - Writes a combined selection file: {prefix}_{name_class}_all.json - Also writes per-length selections: {prefix}_{name_class}_2syl/3syl/4syl.json - Exports matching .txt files for each JSON output
- Parameters:
patch (build_tools.syllable_walk_tui.modules.oscillator.PatchState) – PatchState with corpus data
combiner_state (build_tools.syllable_walk_tui.modules.generator.CombinerState) – CombinerState for candidates path and seed
selector_state (build_tools.syllable_walk_tui.modules.generator.SelectorState) – SelectorState with selection parameters
- Returns:
SelectorResult with selected names and metadata
- Return type:
Note
Caller is responsible for validating patch state and combiner output before calling.