From 4d8a1c189a6e3db083a94ed065f576c7e1787197 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期三, 10 五月 2023 12:02:57 +0800
Subject: [PATCH] Merge pull request #484 from alibaba-damo-academy/dev_sx

---
 funasr/utils/timestamp_tools.py |   31 +++----------------------------
 1 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/funasr/utils/timestamp_tools.py b/funasr/utils/timestamp_tools.py
index 489d317..4e7a8a9 100644
--- a/funasr/utils/timestamp_tools.py
+++ b/funasr/utils/timestamp_tools.py
@@ -80,6 +80,7 @@
 
 
 def time_stamp_sentence(punc_id_list, time_stamp_postprocessed, text_postprocessed):
+    punc_list = ['锛�', '銆�', '锛�', '銆�']
     res = []
     if text_postprocessed is None:
         return res
@@ -124,34 +125,8 @@
         punc_id = int(punc_id) if punc_id is not None else 1
         sentence_end = time_stamp[1] if time_stamp is not None else sentence_end
 
-        if punc_id == 2:
-            sentence_text += ','
-            res.append({
-                'text': sentence_text,
-                "start": sentence_start,
-                "end": sentence_end,
-                "text_seg": sentence_text_seg,
-                "ts_list": ts_list
-            })
-            sentence_text = ''
-            sentence_text_seg = ''
-            ts_list = []
-            sentence_start = sentence_end
-        elif punc_id == 3:
-            sentence_text += '.'
-            res.append({
-                'text': sentence_text,
-                "start": sentence_start,
-                "end": sentence_end,
-                "text_seg": sentence_text_seg,
-                "ts_list": ts_list
-            })
-            sentence_text = ''
-            sentence_text_seg = ''
-            ts_list = []
-            sentence_start = sentence_end
-        elif punc_id == 4:
-            sentence_text += '?'
+        if punc_id > 1:
+            sentence_text += punc_list[punc_id - 2]
             res.append({
                 'text': sentence_text,
                 "start": sentence_start,

--
Gitblit v1.9.1