From 28ccfbfc51068a663a80764e14074df5edf2b5ba Mon Sep 17 00:00:00 2001
From: kongdeqiang <kongdeqiang960204@163.com>
Date: 星期五, 13 三月 2026 17:41:41 +0800
Subject: [PATCH] 提交
---
runtime/tools/fst/ctc_token_fst.py | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/runtime/tools/fst/ctc_token_fst.py b/runtime/tools/fst/ctc_token_fst.py
index e4cdabd..5f06e52 100755
--- a/runtime/tools/fst/ctc_token_fst.py
+++ b/runtime/tools/fst/ctc_token_fst.py
@@ -4,21 +4,20 @@
import sys
-with open(sys.argv[1], 'r') as fread:
- print('0 0 <blank> <eps>')
+with open(sys.argv[1], "r") as fread:
+ print("0 0 <blank> <eps>")
nodeX = 1
for entry in fread.readlines():
- entry = entry.replace('\n', '').strip()
- fields = entry.split(' ')
+ entry = entry.replace("\n", "").strip()
+ fields = entry.split(" ")
phone = fields[0]
- if phone == '<eps>' or phone == '<blank>':
+ if phone == "<eps>" or phone == "<blank>":
continue
- if '#' in phone:
- print(str(0) + ' ' + str(0) + ' ' + '<eps>' + ' ' + phone)
+ if "#" in phone:
+ print(str(0) + " " + str(0) + " " + "<eps>" + " " + phone)
else:
- print(str(0) + ' ' + str(nodeX) + ' ' + phone + ' ' + phone)
- print(str(nodeX) + ' ' + str(nodeX) + ' ' + phone + ' <eps>')
- print(str(nodeX) + ' ' + str(0) + ' ' + '<eps> <eps>')
+ print(str(0) + " " + str(nodeX) + " " + phone + " " + phone)
+ print(str(nodeX) + " " + str(nodeX) + " " + phone + " <eps>")
+ print(str(nodeX) + " " + str(0) + " " + "<eps> <eps>")
nodeX += 1
- print('0')
-
+ print("0")
--
Gitblit v1.9.1