edit cleaners
Browse files- 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 =
|
| 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
|