The dynamic time warping is a technique that is often used for alignment of time series data, with many usages in areas such as biometry.
Surprisingly, it can also be used in computing text similarity!
Let Matuschek et al. tell you about it:
https://www.researchgate.net/publication/221524439_Measuring_text_similarity_with_dynamic_time_warping/figures