imporved segment timesteps readability
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
import time
|
||||||
from sympy import Segment
|
|
||||||
|
|
||||||
ALPHABET = [*"abcdefghijklmnopqrstuvwxyz"]
|
ALPHABET = [*"abcdefghijklmnopqrstuvwxyz"]
|
||||||
|
|
||||||
@@ -84,8 +83,10 @@ class Transcript:
|
|||||||
speaker = seq["speaker"]
|
speaker = seq["speaker"]
|
||||||
|
|
||||||
segm = seq["segment"]
|
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
|
return fstring
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
@@ -122,9 +123,8 @@ class Transcript:
|
|||||||
html = "<p>" + self.__str__().replace("\n", "<br>") + "</p>"
|
html = "<p>" + self.__str__().replace("\n", "<br>") + "</p>"
|
||||||
html = "<html><body>" + html + "</body></html>"
|
html = "<html><body>" + html + "</body></html>"
|
||||||
html = html.replace("\t", " ")
|
html = html.replace("\t", " ")
|
||||||
|
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
def get_md(self) -> str:
|
def get_md(self) -> str:
|
||||||
return self.get_html()
|
return self.get_html()
|
||||||
|
|||||||
Reference in New Issue
Block a user