kdrkdrkdr commited on
Commit
0c05cf0
1 Parent(s): acb2913

edit cleaners

Browse files
Files changed (1) hide show
  1. text/cleaners.py +2 -3
text/cleaners.py CHANGED
@@ -9,13 +9,12 @@ _cleaner_cleans = re.compile('['+'^'.join(symbols)+']')
9
 
10
  def japanese_cleaners(text):
11
  text = japanese_to_romaji_with_accent(text)
12
- text = re.sub(r'([A-Za-z])$', r'\1.', text)
13
  return text
14
 
15
 
16
  def japanese_cleaners2(text):
17
- text = japanese_cleaners(text).replace('ts', 'ʦ').replace('...', '…')
18
- text = '[JA]'+re.sub(r'\[KO\](.*?)\[KO\]', lambda x: korean2katakana(x.group(1))+'.', text)+'[JA]'
19
  text = re.sub(r'\[JA\](.*?)\[JA\]', lambda x: japanese_cleaners(x.group(1))+' ', text)
20
  text = ''.join(_cleaner_cleans.findall(text)).replace(' ', '')
21
  return text
 
9
 
10
  def japanese_cleaners(text):
11
  text = japanese_to_romaji_with_accent(text)
12
+ text = re.sub(r'([A-Za-z])$', r'\1.', text).replace('ts', 'ʦ').replace('...', '…')
13
  return text
14
 
15
 
16
  def japanese_cleaners2(text):
17
+ text = re.sub(r'\[KO\](.*?)\[KO\]', lambda x: '[JA]'+korean2katakana(x.group(1))+'.[JA]', text)
 
18
  text = re.sub(r'\[JA\](.*?)\[JA\]', lambda x: japanese_cleaners(x.group(1))+' ', text)
19
  text = ''.join(_cleaner_cleans.findall(text)).replace(' ', '')
20
  return text