MCPcopy Index your code
hub / github.com/modelscope/FunClip / text

Method text

funclip/utils/subtitle_utils.py:37–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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("、。,")
40 else:
41 res = ""
42 for word in self.token_list:
43 if '\u4e00' <= word <= '\u9fff':
44 res += word
45 else:
46 res += " " + word
47 return res.lstrip().rstrip("、。,")
48 def srt(self, acc_ost=0.0):
49 return "{} --> {}\n{}\n".format(
50 time_convert(self.start_sec+acc_ost*1000),

Callers 2

srtMethod · 0.95
generate_srt_clipFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected