MCPcopy Create free account
hub / github.com/FireRedTeam/FireRedTTS / text_split

Function text_split

fireredtts/modules/text_normalizer/utils.py:158–171  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

156
157
158def text_split(text):
159 if contains_chinese(text):
160 substrings = list(segment("zh", text))
161 new_substrings = []
162 for s in substrings:
163 if len(s) > 30:
164 new_substrings += zh_text_split(s, length=30)
165 else:
166 new_substrings.append(s)
167 substrings = new_substrings
168 else:
169 substrings = list(segment("en", text))
170
171 # merge substrings
172 final_substrings = []
173 temp_string = ""
174 for i in range(len(substrings)):

Callers 1

synthesizeMethod · 0.90

Calls 2

contains_chineseFunction · 0.85
zh_text_splitFunction · 0.85

Tested by

no test coverage detected