sigilyph 0.0.1__py3-none-any.whl → 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sigilyph might be problematic. Click here for more details.
- sigilyph/__init__.py +5 -2
- sigilyph/core/cache_dir/en_tn_tagger.fst +0 -0
- sigilyph/core/cache_dir/en_tn_verbalizer.fst +0 -0
- sigilyph/core/cache_dir/zh_tn_tagger.fst +0 -0
- sigilyph/core/cache_dir/zh_tn_verbalizer.fst +0 -0
- sigilyph/core/norm_func.py +14 -6
- sigilyph/core/py2phone.dict +2165 -0
- sigilyph/core/sigilyph_class.py +8 -8
- sigilyph/core/special_dict.json +26 -0
- sigilyph/core/symbols.py +3 -2
- {sigilyph-0.0.1.dist-info → sigilyph-0.2.1.dist-info}/METADATA +1 -1
- sigilyph-0.2.1.dist-info/RECORD +19 -0
- sigilyph-0.0.1.dist-info/RECORD +0 -13
- {sigilyph-0.0.1.dist-info → sigilyph-0.2.1.dist-info}/WHEEL +0 -0
- {sigilyph-0.0.1.dist-info → sigilyph-0.2.1.dist-info}/top_level.txt +0 -0
sigilyph/core/sigilyph_class.py
CHANGED
|
@@ -5,7 +5,7 @@ Author: Yixiang Chen
|
|
|
5
5
|
version:
|
|
6
6
|
Date: 2025-08-12 14:42:50
|
|
7
7
|
LastEditors: Yixiang Chen
|
|
8
|
-
LastEditTime: 2025-08-12
|
|
8
|
+
LastEditTime: 2025-08-12 19:36:22
|
|
9
9
|
'''
|
|
10
10
|
|
|
11
11
|
import langid
|
|
@@ -49,13 +49,13 @@ class Sigilyph:
|
|
|
49
49
|
|
|
50
50
|
self.special_phrase = special_phrase
|
|
51
51
|
|
|
52
|
-
def forward(self, text, lang):
|
|
53
|
-
phones = self.text_process(text, lang)
|
|
52
|
+
def forward(self, text, lang, spflag=False, norm_use_lang='zh'):
|
|
53
|
+
phones = self.text_process(text, lang, spflag, norm_use_lang)
|
|
54
54
|
phones = self.replace_sil2label(phones)
|
|
55
55
|
return phones
|
|
56
56
|
|
|
57
|
-
def text_process(self, text, lang, spflag=
|
|
58
|
-
text = preprocess_first(text, self.before_replace_dict, special_word_dict, norm_use_lang=
|
|
57
|
+
def text_process(self, text, lang, spflag=False, norm_use_lang='zh'):
|
|
58
|
+
text = preprocess_first(text, self.before_replace_dict, special_word_dict, norm_use_lang=norm_use_lang)
|
|
59
59
|
|
|
60
60
|
multi_lang_text_list = self.text_split_lang(text, lang)
|
|
61
61
|
|
|
@@ -96,7 +96,7 @@ class Sigilyph:
|
|
|
96
96
|
if utext[0] != '[':
|
|
97
97
|
pattern = r'([a-zA-Z ,.\!\?]+|[\u4e00-\u9fa5 ,。,.\t \"\!\?\“\”\、]+)'
|
|
98
98
|
text_split = re.findall(pattern, utext)
|
|
99
|
-
print(text_split)
|
|
99
|
+
#print(text_split)
|
|
100
100
|
for idx in range(len(text_split)):
|
|
101
101
|
tmpts = text_split[idx]
|
|
102
102
|
tmp_lang = langid.classify(tmpts)[0]
|
|
@@ -165,7 +165,7 @@ class Sigilyph:
|
|
|
165
165
|
def postprocess_tts(self, phonelist):
|
|
166
166
|
#outlist = ['sil', '<sp>']
|
|
167
167
|
outlist = []
|
|
168
|
-
print(phonelist)
|
|
168
|
+
#print(phonelist)
|
|
169
169
|
for idx in range(len(phonelist)):
|
|
170
170
|
pm = phonelist[idx]
|
|
171
171
|
if pm not in self.punctuation:
|
|
@@ -188,7 +188,7 @@ class Sigilyph:
|
|
|
188
188
|
return outlist
|
|
189
189
|
|
|
190
190
|
########## replace silence token ###############
|
|
191
|
-
def replace_sil2label(phones):
|
|
191
|
+
def replace_sil2label(self, phones):
|
|
192
192
|
#phones = ['sil_1' if xx == 'sil_lang' else xx for xx in phones]
|
|
193
193
|
phones = ['' if xx == 'sil_lang' else xx for xx in phones]
|
|
194
194
|
phones = ['sil_2' if xx == 'sil_punc' else xx for xx in phones]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"甄嬛传": "[zh en1 h uan2 zh uan4]",
|
|
3
|
+
"藏海传": "[z ang4 h ai3 zh uan4]",
|
|
4
|
+
"藏海": "[z ang4 h ai3]",
|
|
5
|
+
"井柏然": "[j ing3 b o2 r an2]",
|
|
6
|
+
"Alibaba": "[AA a1 l i3 b a1 b a1]",
|
|
7
|
+
"TFBOYS": "[T IY1 EH1 F B OY1 Z]",
|
|
8
|
+
"肖战": "[x iao1 zh an4]",
|
|
9
|
+
"肖申克": "[x iao1 sh en1 k e4]",
|
|
10
|
+
"肖像": "[x iao1 x iang4]",
|
|
11
|
+
"戛纳": "[g a1 n a4]",
|
|
12
|
+
"爆肚": "[b ao4 d u3 EE]",
|
|
13
|
+
"花呗": "[h ua1 b ei4]",
|
|
14
|
+
"肚儿": "[d u3 er5]",
|
|
15
|
+
"种了": "[zh ong4 l e5]",
|
|
16
|
+
"仇老五": "[q iu2 l ao3 w u3]",
|
|
17
|
+
"彩云曲": "[c ai3 y vn2 q v3]",
|
|
18
|
+
"雷洛传": "[l ei2 l uo4 zh uan4]",
|
|
19
|
+
"朝雪录": "[zh ao1 x ve3 l u4]",
|
|
20
|
+
"凡人修仙传": "[f an2 r en2 x iu1 x ian1 zh uan4]",
|
|
21
|
+
"+86": "[b a1 l iu]",
|
|
22
|
+
"(正八十六)": "[b a1 l iu]",
|
|
23
|
+
"八 a.m.": "[sh ang4 w u3 b a1 d ian3]",
|
|
24
|
+
"F.I.R.": "[EH1 F sil_1 AY2 sil_1 AA0 R sil_1]",
|
|
25
|
+
"S.C.I": "[sil_2 EH2 S sil_1 S IY1 sil_1 AY1 sil_1]"
|
|
26
|
+
}
|
sigilyph/core/symbols.py
CHANGED
|
@@ -5,7 +5,7 @@ Author: chenyixiang
|
|
|
5
5
|
version:
|
|
6
6
|
Date: 2024-10-17 11:16:37
|
|
7
7
|
LastEditors: Yixiang Chen
|
|
8
|
-
LastEditTime: 2025-08-12
|
|
8
|
+
LastEditTime: 2025-08-12 17:49:21
|
|
9
9
|
'''
|
|
10
10
|
|
|
11
11
|
|
|
@@ -441,4 +441,5 @@ en_phone_set = [
|
|
|
441
441
|
"SH",
|
|
442
442
|
]
|
|
443
443
|
|
|
444
|
-
|
|
444
|
+
all_phone_set = [] + sorted(set(base_phone_set)) + sorted(set(cn_phone_set)) + sorted(set(en_phone_set))
|
|
445
|
+
all_phone_dict = {xx:idx for idx, xx in enumerate(all_phone_set)}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
sigilyph/__init__.py,sha256=itZex7ZNIS-bD6sCLqA0BeM1htHE68iyAdSN968V8bI,290
|
|
2
|
+
sigilyph/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
sigilyph/core/g2p_func.py,sha256=ccwnMA9VgK0xTWKPVR1Pwb5Gop-CNH5_ipHH8SupNUk,1235
|
|
4
|
+
sigilyph/core/norm_func.py,sha256=HM7ljws4KcBKtzGxIZPiDIuz35DFNIygP4EsjeLRWIQ,3088
|
|
5
|
+
sigilyph/core/predict.py,sha256=Vn7A5TXONqhBe-lJ7uB6Kln9ia1zzYtNzJx5mq_KEBI,1810
|
|
6
|
+
sigilyph/core/preprocess.py,sha256=l55mqh6TK2cuFQhcl8ouys1-U9XfgNFwXLpFeKI17xk,316
|
|
7
|
+
sigilyph/core/py2phone.dict,sha256=RdafObGTAX9OxvHkijDEzsvyvXnsJuY7aPpBKHgic9g,24894
|
|
8
|
+
sigilyph/core/sigilyph_class.py,sha256=T2s-YKbH856VH261waKmvYOMFx002L76rcuK-HBKe3A,8045
|
|
9
|
+
sigilyph/core/special_dict.json,sha256=LtFVDr6OnW8aLCs3z3IzU6rs57aoW8QAiOcqc2bXwys,899
|
|
10
|
+
sigilyph/core/symbols.py,sha256=4IHCCRTiKIaWdMmrUozELlDgkWHAo7l1tPT70Lc_5-w,53898
|
|
11
|
+
sigilyph/core/text_process.py,sha256=NAexBQxTD33pJegQwRPgvun-h6rcJc9Ikx8ZMlsIsNw,11734
|
|
12
|
+
sigilyph/core/cache_dir/en_tn_tagger.fst,sha256=yYMCyIUBnfeq35yr6M0Bn_DSSs-iKoA3uLW4IbSbk-M,5248066
|
|
13
|
+
sigilyph/core/cache_dir/en_tn_verbalizer.fst,sha256=DcK9hJao5KFpWSSVsV3BhJ1QIJfIo9OHU0ahc3YbSLQ,2121910
|
|
14
|
+
sigilyph/core/cache_dir/zh_tn_tagger.fst,sha256=tpcrM-0vFE2WfOPgiQMpV9Tj2AJJVU9P43eHSN_m06s,3758522
|
|
15
|
+
sigilyph/core/cache_dir/zh_tn_verbalizer.fst,sha256=rf-GZBTfZQkzLT402cb6fFktFAnHWNSgto_zPlzZArU,108982
|
|
16
|
+
sigilyph-0.2.1.dist-info/METADATA,sha256=Nn2zV3UhEL0KbxRVBLOZhqQz584YfHMF4cb-ZvX9CTs,686
|
|
17
|
+
sigilyph-0.2.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
18
|
+
sigilyph-0.2.1.dist-info/top_level.txt,sha256=caZwwDzakMbaNNk9MOK172HjSUj1HmJr3oK4iOGUyTo,9
|
|
19
|
+
sigilyph-0.2.1.dist-info/RECORD,,
|
sigilyph-0.0.1.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
sigilyph/__init__.py,sha256=LzNFnxQwBgEn9J_Xigs2Al22xXisVlLW_J_Ujp3yx3E,238
|
|
2
|
-
sigilyph/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
sigilyph/core/g2p_func.py,sha256=ccwnMA9VgK0xTWKPVR1Pwb5Gop-CNH5_ipHH8SupNUk,1235
|
|
4
|
-
sigilyph/core/norm_func.py,sha256=K9NwNf8reiiUfcuKFhte9X5mTkZJm5YBnJB9vxeTY5o,2709
|
|
5
|
-
sigilyph/core/predict.py,sha256=Vn7A5TXONqhBe-lJ7uB6Kln9ia1zzYtNzJx5mq_KEBI,1810
|
|
6
|
-
sigilyph/core/preprocess.py,sha256=l55mqh6TK2cuFQhcl8ouys1-U9XfgNFwXLpFeKI17xk,316
|
|
7
|
-
sigilyph/core/sigilyph_class.py,sha256=wLmykl7qq_KBfuvWazVqku9WYL_XrhDr7n9dQ-pcGbc,7965
|
|
8
|
-
sigilyph/core/symbols.py,sha256=YRTynsUkLlnmGUvVT9yoowJTIx4APfA0Xta1KbfgokQ,53728
|
|
9
|
-
sigilyph/core/text_process.py,sha256=NAexBQxTD33pJegQwRPgvun-h6rcJc9Ikx8ZMlsIsNw,11734
|
|
10
|
-
sigilyph-0.0.1.dist-info/METADATA,sha256=rCVwCkLulNyvAN7rm8IX7SD5sKXMx4MF7w13HrGD-zc,686
|
|
11
|
-
sigilyph-0.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
12
|
-
sigilyph-0.0.1.dist-info/top_level.txt,sha256=caZwwDzakMbaNNk9MOK172HjSUj1HmJr3oK4iOGUyTo,9
|
|
13
|
-
sigilyph-0.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|