(cls, txt, pre_align_args)
| 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 |
no test coverage detected