build_tools.pyphen_syllable_extractor.interactive
Interactive mode for the pyphen syllable extractor.
This module provides the interactive CLI workflow for single-file extraction with language selection and user prompts.
Functions
Interactive prompt to select a language from supported options. |
|
Interactive mode entry point for the pyphen syllable extractor CLI. |
Module Contents
- build_tools.pyphen_syllable_extractor.interactive.select_language()[source]
Interactive prompt to select a language from supported options.
- Returns:
The pyphen language code for the selected language, or “auto” for automatic language detection
- Return type:
Note
Exits the program if the user provides invalid input after multiple attempts or requests to quit.
- build_tools.pyphen_syllable_extractor.interactive.run_interactive()[source]
Interactive mode entry point for the pyphen syllable extractor CLI.
- Workflow:
Prompt user to select a language (or ‘auto’ for automatic detection)
Configure extraction parameters (min/max syllable length)
Prompt for input file path
Extract syllables from input file (with optional auto-detection)
Generate timestamped output filenames
Save syllables and metadata to separate files
Display summary to console
- Language Detection:
If ‘auto’ is selected and langdetect is installed, the tool will automatically detect the language of the input text
Detection requires at least 20-50 characters for reliable results
Falls back to English (en_US) if detection fails
- Output Files:
YYYYMMDD_HHMMSS.syllables.LANG.txt: One syllable per line, sorted
YYYYMMDD_HHMMSS.meta.LANG.txt: Extraction metadata and statistics
Both files are saved to _working/output/ by default.