Add sorting for the collection of text segments.