Delete text/__init__.py
Browse files- text/__init__.py +0 -27
text/__init__.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
# if os.environ.get("version","v1")=="v1":
|
| 3 |
-
# from text.symbols import symbols
|
| 4 |
-
# else:
|
| 5 |
-
# from text.symbols2 import symbols
|
| 6 |
-
|
| 7 |
-
from text import symbols as symbols_v1
|
| 8 |
-
from text import symbols2 as symbols_v2
|
| 9 |
-
|
| 10 |
-
_symbol_to_id_v1 = {s: i for i, s in enumerate(symbols_v1.symbols)}
|
| 11 |
-
_symbol_to_id_v2 = {s: i for i, s in enumerate(symbols_v2.symbols)}
|
| 12 |
-
|
| 13 |
-
def cleaned_text_to_sequence(cleaned_text, version=None):
|
| 14 |
-
'''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
|
| 15 |
-
Args:
|
| 16 |
-
text: string to convert to a sequence
|
| 17 |
-
Returns:
|
| 18 |
-
List of integers corresponding to the symbols in the text
|
| 19 |
-
'''
|
| 20 |
-
if version is None:version=os.environ.get('version', 'v2')
|
| 21 |
-
if version == "v1":
|
| 22 |
-
phones = [_symbol_to_id_v1[symbol] for symbol in cleaned_text]
|
| 23 |
-
else:
|
| 24 |
-
phones = [_symbol_to_id_v2[symbol] for symbol in cleaned_text]
|
| 25 |
-
|
| 26 |
-
return phones
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|