csukuangfj
commited on
Commit
•
f5abfaa
1
Parent(s):
cfd7673
small fixes
Browse files
decode.py
CHANGED
@@ -118,7 +118,7 @@ def decode(
|
|
118 |
|
119 |
for seg, stream in zip(segments, streams):
|
120 |
seg.text = stream.result.text.strip()
|
121 |
-
if
|
122 |
all_text.append(seg.text)
|
123 |
elif len(all_text[-1][0].encode()) == 1 and len(seg.text[0].encode()) == 1:
|
124 |
all_text.append(" ")
|
@@ -127,7 +127,9 @@ def decode(
|
|
127 |
if punct is not None:
|
128 |
seg.text = punct.add_punctuation(seg.text)
|
129 |
segment_list.append(seg)
|
|
|
130 |
all_text = " ".join(all_text)
|
|
|
131 |
if punct is not None:
|
132 |
all_text = punct.add_punctuation(all_text)
|
133 |
|
|
|
118 |
|
119 |
for seg, stream in zip(segments, streams):
|
120 |
seg.text = stream.result.text.strip()
|
121 |
+
if len(all_text) == 0:
|
122 |
all_text.append(seg.text)
|
123 |
elif len(all_text[-1][0].encode()) == 1 and len(seg.text[0].encode()) == 1:
|
124 |
all_text.append(" ")
|
|
|
127 |
if punct is not None:
|
128 |
seg.text = punct.add_punctuation(seg.text)
|
129 |
segment_list.append(seg)
|
130 |
+
logging.info("all text: {all_text}")
|
131 |
all_text = " ".join(all_text)
|
132 |
+
logging.info("all text: {all_text}")
|
133 |
if punct is not None:
|
134 |
all_text = punct.add_punctuation(all_text)
|
135 |
|