MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / process

Method process

data_gen/tts/txt_processors/en.py:65–78  ·  view source on GitHub ↗
(cls, txt, pre_align_args)

Source from the content-addressed store, hash-verified

63
64 @classmethod
65 def process(cls, txt, pre_align_args):
66 txt = cls.preprocess_text(txt).strip()
67 phs = cls.g2p(txt)
68 phs_ = []
69 n_word_sep = 0
70 for p in phs:
71 if p.strip() == '':
72 phs_ += ['|']
73 n_word_sep += 1
74 else:
75 phs_ += p.split(" ")
76 phs = phs_
77 assert n_word_sep + 1 == len(txt.split(" ")), (phs, f"\"{txt}\"")
78 return phs, txt

Callers 1

binarizeFunction · 0.45

Calls 1

preprocess_textMethod · 0.45

Tested by

no test coverage detected