Function similar::get_diff_ratio[][src]

pub fn get_diff_ratio(ops: &[DiffOp], old_len: usize, new_len: usize) -> f32

Return a measure of similarity in the range 0..=1.

A ratio of 1.0 means the two sequences are a complete match, a ratio of 0.0 would indicate completely distinct sequences. The input is the sequence of diff operations and the length of the old and new sequence.