Skip to content

Commit

Permalink
Update cleaners.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CjangCjengh committed Dec 2, 2022
1 parent a88d0f2 commit 4952f60
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions text/cleaners.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ def shanghainese_cleaners(text):


def chinese_dialect_cleaners(text):
text = re.sub(r'\[MD\](.*?)\[MD\]',
text = re.sub(r'\[ZH\](.*?)\[ZH\]',
lambda x: chinese_to_ipa2(x.group(1))+' ', text)
text = re.sub(r'\[TW\](.*?)\[TW\]',
lambda x: chinese_to_ipa2(x.group(1), True)+' ', text)
text = re.sub(r'\[JA\](.*?)\[JA\]',
lambda x: japanese_to_ipa3(x.group(1)).replace('Q', 'ʔ')+' ', text)
text = re.sub(r'\[SH\](.*?)\[SH\]', lambda x: shanghainese_to_ipa(x.group(1)).replace('1', '˥˧').replace('5',
Expand Down

0 comments on commit 4952f60

Please sign in to comment.