(text)
| 156 | |
| 157 | |
| 158 | def 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)): |
no test coverage detected