diff --git a/autotranscript/transcript_exporter.py b/autotranscript/transcript_exporter.py index 12cdefb..3ae53a6 100644 --- a/autotranscript/transcript_exporter.py +++ b/autotranscript/transcript_exporter.py @@ -1,6 +1,5 @@ import json - -from sympy import Segment +import time ALPHABET = [*"abcdefghijklmnopqrstuvwxyz"] @@ -84,8 +83,10 @@ class Transcript: speaker = seq["speaker"] segm = seq["segment"] + sseg = time.strftime("%H:%M:%S",time.gmtime(segm[0])) + eseg = time.strftime("%H:%M:%S",time.gmtime(segm[1])) - fstring += f"{speaker} {segm}: {seq['text']}\n" + fstring += f"{speaker} ({sseg} ; {eseg}): {seq['text']}\n" return fstring def __repr__(self) -> str: @@ -122,9 +123,8 @@ class Transcript: html = "

" + self.__str__().replace("\n", "
") + "

" html = "" + html + "" html = html.replace("\t", "    ") - - return html - + + return html def get_md(self) -> str: return self.get_html()