Mahiruoshi commited on
Commit
8116260
1 Parent(s): 6117706

Update text/cleaners.py

Browse files
Files changed (1) hide show
  1. text/cleaners.py +8 -6
text/cleaners.py CHANGED
@@ -4,12 +4,14 @@ from unidecode import unidecode
4
  from unidecode import unidecode
5
  import ctypes
6
  from text.mandarin import number_to_chinese, chinese_to_bopomofo, latin_to_bopomofo, chinese_to_romaji, chinese_to_lazy_ipa, chinese_to_ipa, chinese_to_ipa2
7
- dll = ctypes.cdll.LoadLibrary('cleaners/JapaneseCleaner.dll')
8
- dll.CreateOjt.restype = ctypes.c_uint64
9
- dll.PluginMain.restype = ctypes.c_uint64
10
- floder = ctypes.create_unicode_buffer("cleaners")
11
- dll.CreateOjt(floder)
12
-
 
 
13
  def clean_japanese(text):
14
  input_wchar_pointer = ctypes.create_unicode_buffer(text)
15
  result = ctypes.wstring_at(dll.PluginMain(input_wchar_pointer))
 
4
  from unidecode import unidecode
5
  import ctypes
6
  from text.mandarin import number_to_chinese, chinese_to_bopomofo, latin_to_bopomofo, chinese_to_romaji, chinese_to_lazy_ipa, chinese_to_ipa, chinese_to_ipa2
7
+ try:
8
+ dll = ctypes.cdll.LoadLibrary('cleaners/JapaneseCleaner.dll')
9
+ dll.CreateOjt.restype = ctypes.c_uint64
10
+ dll.PluginMain.restype = ctypes.c_uint64
11
+ floder = ctypes.create_unicode_buffer("cleaners")
12
+ dll.CreateOjt(floder)
13
+ except:
14
+ pass
15
  def clean_japanese(text):
16
  input_wchar_pointer = ctypes.create_unicode_buffer(text)
17
  result = ctypes.wstring_at(dll.PluginMain(input_wchar_pointer))