We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ed44e3e commit 0a8c747Copy full SHA for 0a8c747
2 files changed
itn/chinese/rules/cardinal.py
@@ -172,7 +172,7 @@ def build_tagger(self):
172
# 5. 添加"中文数字+英文字母"的规则,如"四a" -> "4a"
173
# 匹配一个或多个英文字母(大小写)
174
from pynini import union
175
- english_letters = union(*[accep(c) for c in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"])
+ english_letters = union(*[accep(c) for c in "abcdABCD"])
176
# 数字+字母的组合,如"四a" -> "4a"
177
number_with_letter = number + english_letters.plus
178
cardinal |= add_weight(number_with_letter, 0.05) # 使用较高优先级
itn/zh_itn_tagger.fst
-17.9 KB
0 commit comments