FarmanMansoori commited on
Commit
5c9714c
·
verified ·
1 Parent(s): 4a1af29

Update txtsplit/txtsplit/__init__.py

Browse files
Files changed (1) hide show
  1. txtsplit/txtsplit/__init__.py +12 -15
txtsplit/txtsplit/__init__.py CHANGED
@@ -1,15 +1,12 @@
1
- # Minimal txtsplit shim used only to satisfy MeloTTS's dependency.
2
- # Provides a simple `split` and `split_text` function that returns sentence list.
3
-
4
- import re
5
- from typing import List
6
-
7
- def split(text: str) -> List[str]:
8
- if not text:
9
- return []
10
- # naive sentence split — enough for most TTS uses
11
- parts = re.split(r'(?<=[.!?])\s+', text.strip())
12
- return [p.strip() for p in parts if p.strip()]
13
-
14
- # alias that some libs might expect
15
- split_text = split
 
1
+ # txtsplit shim for MeloTTS dependency
2
+ import re
3
+ from typing import List
4
+
5
+ def split(text: str) -> List[str]:
6
+ if not text:
7
+ return []
8
+ parts = re.split(r'(?<=[.!?])\s+', text.strip())
9
+ return [p.strip() for p in parts if p.strip()]
10
+
11
+ # alias some code may expect
12
+ split_text = split