An algorithm for segment durations in a reading machine context