Segment-based distances and similarities in genomic sequences