build_tools.name_combiner.cli
Command-line interface for the name combiner.
This module provides the CLI for generating name candidates from an annotated syllable corpus. It follows the project’s CLI documentation standards with sphinx-argparse compatible argument parser.
Usage
Generate 2-syllable candidates:
python -m build_tools.name_combiner \
--run-dir _working/output/20260110_115453_pyphen/ \
--syllables 2 \
--count 10000 \
--seed 42
Generate 3-syllable candidates with uniform sampling:
python -m build_tools.name_combiner \
--run-dir _working/output/20260110_115453_pyphen/ \
--syllables 3 \
--count 5000 \
--frequency-weight 0.0
Functions
Create and return the argument parser for the name combiner. |
|
|
Parse command-line arguments. |
|
Discover the annotated JSON file in a run directory. |
|
Main entry point for the name combiner CLI. |
Module Contents
- build_tools.name_combiner.cli.create_argument_parser()[source]
Create and return the argument parser for the name combiner.
Returns
- argparse.ArgumentParser
Configured ArgumentParser ready to parse command-line arguments.
Notes
This function follows the project’s CLI documentation standards, enabling sphinx-argparse to auto-generate documentation.
- build_tools.name_combiner.cli.parse_arguments(args=None)[source]
Parse command-line arguments.
Parameters
- argslist[str] | None, optional
Arguments to parse. If None, uses sys.argv.
Returns
- argparse.Namespace
Parsed arguments.
- build_tools.name_combiner.cli.discover_annotated_json(run_dir)[source]
Discover the annotated JSON file in a run directory.
Parameters
- run_dirPath
Path to extraction run directory.
Returns
- tuple[Path, str]
(path_to_annotated_json, prefix) where prefix is ‘pyphen’ or ‘nltk’.
Raises
- FileNotFoundError
If no annotated JSON is found.
- ValueError
If run directory structure is unexpected.