소스 검색

Optimize text parser

Lengyue 2 년 전
부모
커밋
5c9b1dc1b1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      fish_speech/text/parser.py

+ 1 - 1
fish_speech/text/parser.py

@@ -150,7 +150,7 @@ def parse_unknown_segment(text, order):
     last_idx, last_language = 0, None
 
     for idx, char in enumerate(text):
-        if char in punctuation or char in string.digits:
+        if char == " " or char in punctuation or char in string.digits:
             # If the punctuation / number is in the middle of the text,
             # we should not split the text.
             detected_language = last_language or order[0]