(self, text, timestamp, offset=0)
| 28 | |
| 29 | class Text2SRT(): |
| 30 | def __init__(self, text, timestamp, offset=0): |
| 31 | self.token_list = text |
| 32 | self.timestamp = timestamp |
| 33 | start, end = timestamp[0][0] - offset, timestamp[-1][1] - offset |
| 34 | self.start_sec, self.end_sec = start, end |
| 35 | self.start_time = time_convert(start) |
| 36 | self.end_time = time_convert(end) |
| 37 | def text(self): |
| 38 | if isinstance(self.token_list, str): |
| 39 | return self.token_list.rstrip("、。,") |
nothing calls this directly
no test coverage detected