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

select_language()

Interactive prompt to select a language from supported options.

run_interactive()

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:

str

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:
  1. Prompt user to select a language (or ‘auto’ for automatic detection)

  2. Configure extraction parameters (min/max syllable length)

  3. Prompt for input file path

  4. Extract syllables from input file (with optional auto-detection)

  5. Generate timestamped output filenames

  6. Save syllables and metadata to separate files

  7. 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.