feat: update split patterns

This commit is contained in:
Ayo Ayco 2025-09-06 10:59:10 +02:00
parent cb920badc9
commit 2b034f80c6

5
tts.py
View file

@ -176,11 +176,14 @@ def main():
- statements ending in punctuations (:.?!;) - statements ending in punctuations (:.?!;)
- list items starting in '-' or '*' - list items starting in '-' or '*'
- numbered items starting with a digit followed by a dot '.' - numbered items starting with a digit followed by a dot '.'
- if a new line starts with a capital letter
''' '''
sp = r'\n{2,}|[:.?!;]\n+|\n[(\* )(\- )(\d\. )]|\n[A-Z]'
generator = pipeline( generator = pipeline(
text, text,
voice=voice, voice=voice,
split_pattern=r'\n{2,}|[:.?!;]\n+|\n[\*\-(\d+\.)]' split_pattern=sp
) )
if args.verbose: if args.verbose: