| | |
| | | from typing import Collection |
| | | |
| | | from jaconv import jaconv |
| | | import tacotron_cleaner.cleaners |
| | | from typeguard import check_argument_types |
| | | # import tacotron_cleaner.cleaners |
| | | |
| | | try: |
| | | from vietnamese_cleaner import vietnamese_cleaners |
| | |
| | | """ |
| | | |
| | | def __init__(self, cleaner_types: Collection[str] = None): |
| | | assert check_argument_types() |
| | | |
| | | if cleaner_types is None: |
| | | self.cleaner_types = [] |
| | |
| | | def __call__(self, text: str) -> str: |
| | | for t in self.cleaner_types: |
| | | if t == "tacotron": |
| | | text = tacotron_cleaner.cleaners.custom_english_cleaners(text) |
| | | # text = tacotron_cleaner.cleaners.custom_english_cleaners(text) |
| | | pass |
| | | elif t == "jaconv": |
| | | text = jaconv.normalize(text) |
| | | elif t == "vietnamese": |