提交 a861e56e 编写于 作者: 小湉湉's avatar 小湉湉 提交者: root

rm space for pure Chinese

上级 dad1cbbc
......@@ -36,7 +36,7 @@ def evaluate(args, fastspeech2_config, pwg_config):
for line in f:
items = line.strip().split()
utt_id = items[0]
sentence = ",".join(items[1:])
sentence = "".join(items[1:])
sentences.append((utt_id, sentence))
with open(args.phones_dict, "r") as f:
......
......@@ -84,7 +84,7 @@ def main():
for line in f:
items = line.strip().split()
utt_id = items[0]
sentence = ",".join(items[1:])
sentence = "".join(items[1:])
sentences.append((utt_id, sentence))
for utt_id, sentence in sentences:
......
......@@ -39,7 +39,7 @@ def evaluate(args, fastspeech2_config, pwg_config):
for line in f:
items = line.strip().split()
utt_id = items[0]
sentence = ",".join(items[1:])
sentence = "".join(items[1:])
sentences.append((utt_id, sentence))
with open(args.phones_dict, "r") as f:
......
......@@ -42,7 +42,7 @@ def evaluate(args, fastspeech2_config, pwg_config):
for line in f:
items = line.strip().split()
utt_id = items[0]
sentence = ",".join(items[1:])
sentence = "".join(items[1:])
sentences.append((utt_id, sentence))
with open(args.phones_dict, "r") as f:
......
......@@ -42,7 +42,7 @@ def evaluate(args, fastspeech2_config, melgan_config):
for line in f:
items = line.strip().split()
utt_id = items[0]
sentence = ",".join(items[1:])
sentence = "".join(items[1:])
sentences.append((utt_id, sentence))
with open(args.phones_dict, "r") as f:
......
......@@ -89,7 +89,7 @@ def main():
for line in f:
items = line.strip().split()
utt_id = items[0]
sentence = ",".join(items[1:])
sentence = "".join(items[1:])
sentences.append((utt_id, sentence))
for utt_id, sentence in sentences:
......
......@@ -42,7 +42,7 @@ def evaluate(args, speedyspeech_config, pwg_config):
for line in f:
items = line.strip().split()
utt_id = items[0]
sentence = ",".join(items[1:])
sentence = "".join(items[1:])
sentences.append((utt_id, sentence))
with open(args.phones_dict, "r") as f:
......
......@@ -129,6 +129,8 @@ class Frontend():
# we discriminate i, ii and iii
if c and c not in self.punc:
phones.append(c)
if c and c in self.punc:
phones.append('sp')
if v and v not in self.punc:
phones.append(v)
# add sp between sentence (replace the last punc with sp)
......
......@@ -64,6 +64,8 @@ class TextNormalizer():
List[str]
Sentences.
"""
# Only for pure Chinese here
text = text.replace(" ", "")
text = self.SENTENCE_SPLITOR.sub(r'\1\n', text)
text = text.strip()
sentences = [sentence.strip() for sentence in re.split(r'\n+', text)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册