We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbb4cba commit 093a6f9Copy full SHA for 093a6f9
4 files changed
tn/chinese/data/measure/units_zh.tsv
@@ -239,3 +239,4 @@
239
度
240
摄氏度
241
字
242
+兆
tn/chinese/rules/cardinal.py
@@ -76,6 +76,7 @@ def build_tagger(self):
76
# three or five or eleven phone numbers
77
phone_digits = digits @ self.build_rule(cross('一', '幺'))
78
phone = phone_digits**3 | phone_digits**5 | phone_digits**11
79
+ phone |= accep("尾号") + (accep("是") | accep("为")).ques + phone_digits**4
80
cardinal |= add_weight(phone, -1.0)
81
82
tagger = insert('value: "') + cardinal + insert('"')
tn/chinese/test/data/cardinal.txt
@@ -1,3 +1,6 @@
1
110 => 幺幺零
2
127.0.0.1 => 一二七点零点零点一
3
010-64035547 => 零一零六四零三五五四七
4
+尾号1702 => 尾号幺七零二
5
+尾号是3385 => 尾号是三三八五
6
+尾号为2349 => 尾号为二三四九
tn/chinese/test/data/measure.txt
@@ -8,3 +8,4 @@
8
1 kg => 一千克
9
2% => 百分之二
10
10km/h => 每小时十公里
11
+100兆 => 一百兆
0 commit comments