Function aligner::align [] [src]

pub fn align(list: Vec<TimeSpan>,
             reference: Vec<TimeSpan>,
             split_penalty_normalized: f64,
             progress_handler: Option<Box<ProgressHandler>>)
             -> Vec<TimeDelta>

Matches an incorrect subtitle list to a reference subtitle list.

Returns the delta for every time span in list.

The split_penalty_normalized is a value between 0 and 1. Providing 0 will make the algorithm indifferent of splitting lines (resulting in MANY different deltas), so this is not recommended. Providing 1 will assure that no split will occur, so only one/the best offset is applied to ALL lines. The most common useful values are in the 0.2 to 0.01 range.

Especially for larger subtitles(e.g. 1 hour in millisecond resolution and 1000 subtitle lines) this process might take some seconds. To provide user feedback one can pass a ProgressHandler to this function.