def token_to_char_position(tokens, start_token, end_token):
  """Converts a token positions to char positions within the tokens."""
  start_char = 0
  end_char = 0
  for i in range(end_token):
    tok = tokens[i]
    end_char += len(tok) + 1
    if i == start_token:
      start_char = end_char
  return start_char, end_char