<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def translate_diff(origtext,deltas):
  'take diff run on separated words and convert the deltas to character offsets'
  lens=[0]+cumsum(map(len,splitpreserve(origtext))) # [0] at the head for like 'length before'
  return [Delta(lens[a],lens[b],''.join(replace)) for a,b,replace in deltas]