build_tools.pyphen_syllable_extractor.cli ========================================= .. py:module:: build_tools.pyphen_syllable_extractor.cli .. autoapi-nested-parse:: Command-line interface for the pyphen syllable extractor. This module provides the CLI entry point and argument parser for the pyphen-based syllable extractor. The actual processing logic is in: - ``interactive.py`` - Interactive mode with language selection - ``batch.py`` - Batch mode for processing multiple files Usage:: # Interactive mode (no arguments) python -m build_tools.pyphen_syllable_extractor # Batch mode (with arguments) python -m build_tools.pyphen_syllable_extractor --file input.txt python -m build_tools.pyphen_syllable_extractor --source ~/corpus/ --recursive Attributes ---------- .. autoapisummary:: build_tools.pyphen_syllable_extractor.cli.main_batch build_tools.pyphen_syllable_extractor.cli.main_interactive build_tools.pyphen_syllable_extractor.cli.process_single_file_batch Functions --------- .. autoapisummary:: build_tools.pyphen_syllable_extractor.cli.create_argument_parser build_tools.pyphen_syllable_extractor.cli.main Module Contents --------------- .. py:data:: main_batch .. py:data:: main_interactive .. py:data:: process_single_file_batch .. py:function:: create_argument_parser() Create and configure the argument parser for batch mode. This function sets up the argparse parser with all command-line options for batch processing mode. The parser supports mutually exclusive groups for input specification and language selection. :returns: Configured ArgumentParser instance ready to parse sys.argv. .. admonition:: Example >>> parser = create_argument_parser() >>> args = parser.parse_args(["--file", "input.txt", "--lang", "en_US"]) >>> print(args.file) PosixPath('input.txt') .. py:function:: main(args = None) Main entry point for the pyphen syllable extractor CLI. This function determines whether to run in interactive or batch mode based on the presence of command-line arguments. :param args: Command-line arguments. If None, uses sys.argv. :returns: Exit code (0 for success, non-zero for error). Modes: - Interactive Mode: No arguments provided. Prompts user for all settings. - Batch Mode: Arguments provided. Processes files based on CLI flags. .. admonition:: Examples Interactive mode (no arguments):: $ python -m build_tools.pyphen_syllable_extractor Batch mode (with arguments):: $ python -m build_tools.pyphen_syllable_extractor --file input.txt --lang en_US $ python -m build_tools.pyphen_syllable_extractor --files *.txt --auto $ python -m build_tools.pyphen_syllable_extractor --source ~/docs/ --recursive --auto