File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,15 @@ class TimedText:
66 text : Optional [str ] = None
77 start : Optional [float ] = 0
88 end : Optional [float ] = 0
9+
10+ def duration (self ) -> float :
11+ return self .end - self .start
12+
13+ def contains_time (self , time : float ) -> bool :
14+ return self .start <= time <= self .end
15+
16+ def contains_timespan (self , other : 'TimedText' ) -> bool :
17+ return self .start <= other .start and self .end >= other .end
918
1019 def overlaps_with (self , other : 'TimedText' ) -> bool :
1120 return not (self .end <= other .start or other .end <= self .start )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " nllw"
7- version = " 0.1.1"
7+ version = " 0.1.1.post1 "
88description = " Simultaneous Machine Translation (SimulMT) with NLLB model optimization"
99readme = " README.md"
1010requires-python = " >=3.8"
You can’t perform that action at this time.
0 commit comments