def spans_to_relative(spans):
 prev = 0
 for (left, right) in spans:
  (yield ((left - prev), (right - left)))
  prev = right

def spans_to_relative ( spans ) : prev = 0 for ( left , right ) in spans : ( yield ( ( left - prev ) , ( right - left ) ) ) prev = right
return a sequence of relative spans .