terminal out

This commit is contained in:
Gauthier
2022-03-17 15:29:44 +01:00
parent c76875a08d
commit 72b984bf48
2 changed files with 24 additions and 7 deletions
+8 -3
View File
@@ -22,7 +22,9 @@ def fragments(utterance: str):
frags = []
sentences = utterance.splitlines()
PUNCT_RE = regex.compile(r'(\p{Punctuation})')
PUNCT_RE = regex.compile(r'(\p{Punctuation})')
skip_punctuation = ["'"]
for s in sentences:
sf = PUNCT_RE.split(s)
@@ -36,8 +38,11 @@ def fragments(utterance: str):
cum += k
else:
cum += k
frags.append(cum)
cum = ""
if k in skip_punctuation:
continue
else:
frags.append(cum)
cum = ""
cum += '\n'
frags.append(cum)