Add trim CLI command
This commit is contained in:
@@ -95,6 +95,9 @@ func Apply(input schema.Transcript, opts Options) (Result, error) {
|
||||
}
|
||||
|
||||
kept, groups := recomputeOverlapGroups(kept)
|
||||
if groups == nil {
|
||||
groups = make([]schema.OverlapGroup, 0)
|
||||
}
|
||||
|
||||
out := copyTranscript(input)
|
||||
out.Segments = kept
|
||||
@@ -278,7 +281,7 @@ func validateSelectedIDsExist(selected []int, idIndex map[int]int) error {
|
||||
|
||||
func recomputeOverlapGroups(segments []schema.Segment) ([]schema.Segment, []schema.OverlapGroup) {
|
||||
if len(segments) == 0 {
|
||||
return segments, nil
|
||||
return segments, make([]schema.OverlapGroup, 0)
|
||||
}
|
||||
|
||||
modelSegments := make([]model.Segment, len(segments))
|
||||
|
||||
Reference in New Issue
Block a user