Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
h2p revert text_processing changes
Browse files
resources/app/python/xvapitch/text/text_preprocessing.py
CHANGED
@@ -15,6 +15,7 @@ import epitran
|
|
15 |
import nltk
|
16 |
nltk.download('punkt', quiet=True)
|
17 |
from nltk.tokenize import word_tokenize
|
|
|
18 |
|
19 |
# I really need to find a better way to do this (handling many different possible entry points)
|
20 |
try:
|
@@ -22,24 +23,20 @@ try:
|
|
22 |
from resources.app.python.xvapitch.text.ipa_to_xvaarpabet import ESpeak, ipa2xvaarpabet, PUNCTUATION, ALL_SYMBOLS, PIN_YIN_ENDS, pinyin_to_arpabet_mappings, text_pinyin_to_pinyin_symbs, manual_phone_replacements
|
23 |
from resources.app.python.xvapitch.text.en_numbers import normalize_numbers as en_normalize_numbers
|
24 |
from resources.app.python.xvapitch.text.ro_numbers import generateWords as ro_generateWords
|
25 |
-
from resources.app.python.xvapitch.text.h2p_parser.h2p import H2p
|
26 |
except ModuleNotFoundError:
|
27 |
try:
|
28 |
from python.xvapitch.text.ipa_to_xvaarpabet import ESpeak, ipa2xvaarpabet, PUNCTUATION, ALL_SYMBOLS, PIN_YIN_ENDS, pinyin_to_arpabet_mappings, text_pinyin_to_pinyin_symbs, manual_phone_replacements
|
29 |
from python.xvapitch.text.en_numbers import normalize_numbers as en_normalize_numbers
|
30 |
from python.xvapitch.text.ro_numbers import generateWords as ro_generateWords
|
31 |
-
from python.xvapitch.text.h2p_parser.h2p import H2p
|
32 |
except ModuleNotFoundError:
|
33 |
try:
|
34 |
from text.ipa_to_xvaarpabet import ESpeak, ipa2xvaarpabet, PUNCTUATION, ALL_SYMBOLS, PIN_YIN_ENDS, pinyin_to_arpabet_mappings, text_pinyin_to_pinyin_symbs, manual_phone_replacements
|
35 |
from text.en_numbers import normalize_numbers as en_normalize_numbers
|
36 |
from text.ro_numbers import generateWords as ro_generateWords
|
37 |
-
from text.h2p_parser.h2p import H2p
|
38 |
except ModuleNotFoundError:
|
39 |
from ipa_to_xvaarpabet import ESpeak, ipa2xvaarpabet, PUNCTUATION, ALL_SYMBOLS, PIN_YIN_ENDS, pinyin_to_arpabet_mappings, text_pinyin_to_pinyin_symbs, manual_phone_replacements
|
40 |
from en_numbers import normalize_numbers as en_normalize_numbers
|
41 |
from ro_numbers import generateWords as ro_generateWords
|
42 |
-
from h2p_parser.h2p import H2p
|
43 |
|
44 |
|
45 |
|
|
|
15 |
import nltk
|
16 |
nltk.download('punkt', quiet=True)
|
17 |
from nltk.tokenize import word_tokenize
|
18 |
+
from h2p_parser.h2p import H2p
|
19 |
|
20 |
# I really need to find a better way to do this (handling many different possible entry points)
|
21 |
try:
|
|
|
23 |
from resources.app.python.xvapitch.text.ipa_to_xvaarpabet import ESpeak, ipa2xvaarpabet, PUNCTUATION, ALL_SYMBOLS, PIN_YIN_ENDS, pinyin_to_arpabet_mappings, text_pinyin_to_pinyin_symbs, manual_phone_replacements
|
24 |
from resources.app.python.xvapitch.text.en_numbers import normalize_numbers as en_normalize_numbers
|
25 |
from resources.app.python.xvapitch.text.ro_numbers import generateWords as ro_generateWords
|
|
|
26 |
except ModuleNotFoundError:
|
27 |
try:
|
28 |
from python.xvapitch.text.ipa_to_xvaarpabet import ESpeak, ipa2xvaarpabet, PUNCTUATION, ALL_SYMBOLS, PIN_YIN_ENDS, pinyin_to_arpabet_mappings, text_pinyin_to_pinyin_symbs, manual_phone_replacements
|
29 |
from python.xvapitch.text.en_numbers import normalize_numbers as en_normalize_numbers
|
30 |
from python.xvapitch.text.ro_numbers import generateWords as ro_generateWords
|
|
|
31 |
except ModuleNotFoundError:
|
32 |
try:
|
33 |
from text.ipa_to_xvaarpabet import ESpeak, ipa2xvaarpabet, PUNCTUATION, ALL_SYMBOLS, PIN_YIN_ENDS, pinyin_to_arpabet_mappings, text_pinyin_to_pinyin_symbs, manual_phone_replacements
|
34 |
from text.en_numbers import normalize_numbers as en_normalize_numbers
|
35 |
from text.ro_numbers import generateWords as ro_generateWords
|
|
|
36 |
except ModuleNotFoundError:
|
37 |
from ipa_to_xvaarpabet import ESpeak, ipa2xvaarpabet, PUNCTUATION, ALL_SYMBOLS, PIN_YIN_ENDS, pinyin_to_arpabet_mappings, text_pinyin_to_pinyin_symbs, manual_phone_replacements
|
38 |
from en_numbers import normalize_numbers as en_normalize_numbers
|
39 |
from ro_numbers import generateWords as ro_generateWords
|
|
|
40 |
|
41 |
|
42 |
|