def compress_tokens(tokens):
 result = [tokens[0]]
 for tok in tokens[1:]:
  if ((not result[(-1)].post_tags) and (not tok.pre_tags) and (result[(-1)].annotation == tok.annotation)):
   compress_merge_back(result, tok)
  else:
   result.append(tok)
 return result

def compress_tokens ( tokens ) : result = [ tokens [ 0 ] ] for tok in tokens [ 1 : ] : if ( ( not result [ ( - 1 ) ] . post_tags ) and ( not tok . pre_tags ) and ( result [ ( - 1 ) ] . annotation == tok . annotation ) ) : compress_merge_back ( result , tok ) else : result . append ( tok ) return result
combine adjacent tokens when there is no html between the tokens .