skytnt commited on
Commit
dfdeaec
1 Parent(s): c86d965
Files changed (1) hide show
  1. text/cleaners.py +4 -4
text/cleaners.py CHANGED
@@ -441,7 +441,7 @@ def transliteration_cleaners(text):
441
 
442
  def japanese_cleaners(text):
443
  text = japanese_to_romaji_with_accent(text)
444
- if re.match('[A-Za-z]', text[-1]):
445
  text += '.'
446
  return text
447
 
@@ -456,7 +456,7 @@ def korean_cleaners(text):
456
  text = number_to_hangul(text)
457
  text = j2hcj(h2j(text))
458
  text = divide_hangul(text)
459
- if re.match('[\u3131-\u3163]', text[-1]):
460
  text += '.'
461
  return text
462
 
@@ -466,7 +466,7 @@ def chinese_cleaners(text):
466
  text = number_to_chinese(text)
467
  text = chinese_to_bopomofo(text)
468
  text = latin_to_bopomofo(text)
469
- if re.match('[ˉˊˇˋ˙]', text[-1]):
470
  text += '。'
471
  return text
472
 
@@ -490,6 +490,6 @@ def zh_ja_mixture_cleaners(text):
490
  '...', '…')
491
  text = text.replace(japanese_text, cleaned_text + ' ', 1)
492
  text = text[:-1]
493
- if re.match('[A-Za-zɯɹəɥ→↓↑]', text[-1]):
494
  text += '.'
495
  return text
 
441
 
442
  def japanese_cleaners(text):
443
  text = japanese_to_romaji_with_accent(text)
444
+ if len(text) > 0 and re.match('[A-Za-z]', text[-1]):
445
  text += '.'
446
  return text
447
 
 
456
  text = number_to_hangul(text)
457
  text = j2hcj(h2j(text))
458
  text = divide_hangul(text)
459
+ if len(text) > 0 and re.match('[\u3131-\u3163]', text[-1]):
460
  text += '.'
461
  return text
462
 
 
466
  text = number_to_chinese(text)
467
  text = chinese_to_bopomofo(text)
468
  text = latin_to_bopomofo(text)
469
+ if re.match('[ˉˊˇˋ˙]', text[-1]):
470
  text += '。'
471
  return text
472
 
 
490
  '...', '…')
491
  text = text.replace(japanese_text, cleaned_text + ' ', 1)
492
  text = text[:-1]
493
+ if len(text) > 0 and re.match('[A-Za-zɯɹəɥ→↓↑]', text[-1]):
494
  text += '.'
495
  return text