def unshift_token(text):
    """Remove a token from the front of a string.

    :param str text:
    :returns: {'text': str, 'separator': str, 'remainder': str}
    """
    if len(text) == 0:
        return {'text': text, 'separator': '', 'remainder': ''}
    token = ''
    for i in range(0, len(text)):
        char = text[i]
        if char == ' ' and (len(token) >= 1 and token[i - 1] == ' '):
            token += char
        elif char == ' ' and len(token) == 0:
            token += char
        elif char == ' ':
            return {'text': token, 'separator': ' ', 'remainder': text[i + 1:]}
        elif char == '\n':
            return {'text': token, 'separator': '\n', 'remainder': text[i + 1:]
                }
        elif len(token) >= 1 and token[i - 1] == ' ':
            return {'text': token, 'separator': '', 'remainder': text[len(
                token):]}
        else:
            token += char
    return {'text': token, 'separator': '', 'remainder': ''}
