Files
diodiogod-TTS-Audio-Suite/utils/text/character_parser.py
T
diodiogod e129c5314b IndexTTS-2 implementation with modular character parser
MAJOR: IndexTTS-2 TTS engine integration
- Core IndexTTS engine with unified model interface integration
- Auto-downloader for HuggingFace models + GitHub source code
- Engine adapter with emotion support [Alice:angry_bob] syntax
- Cache integration for IndexTTS-2 parameters
- Factory registration for proper model management

MAJOR: Character parser modularization (930 → 300 lines each)
- Split into base_parser.py, language_resolver.py, segment_processor.py, validation.py
- Added emotion support with backward compatibility
- New split_by_character_with_emotions() method for advanced engines
- Flexible tag parsing: [de:Alice:angry_bob] support
- Language disambiguation to avoid Alice vs language code conflicts
- Full backward compatibility maintained

FEATURES:
- IndexTTS-2 emotion disentanglement (speaker vs emotion separation)
- Duration control and precise voice cloning
- Multi-modal emotion control (audio refs, text, vectors)
- Character switching with emotion references
- All official IndexTTS-2 parameters exposed

DOCS: Implementation plan and architectural TODO items added
2025-09-11 20:26:51 -03:00

32 lines
1.2 KiB
Python

"""
Character Parser for ChatterBox Voice - Universal Text Processing
Backward Compatibility Module
The original 930-line character parser has been modularized for better maintainability.
This module maintains backward compatibility by delegating to the new modular structure.
New modular structure:
- utils/text/character_parser/
├── __init__.py # Main exports
├── base_parser.py # Core CharacterParser class (~300 lines)
├── language_resolver.py # Language resolution logic (~200 lines)
├── segment_processor.py # Text segmentation logic (~200 lines)
└── validation.py # Validation and statistics (~150 lines)
Each module is now ~150-300 lines, following the 500-600 line policy.
"""
# Import everything from the modular structure for backward compatibility
from .character_parser import *
# Ensure global instances are available at module level
from .character_parser import character_parser
# Additional convenience exports that may be expected
__all__ = [
'CharacterParser',
'CharacterSegment',
'character_parser',
'parse_character_text',
'validate_character_text'
]