def get_distance_to_root(token, parser):
    """
    Receives a token and returns its distance from the root
    :param token: the token
    :param parser: the spacy wrapper object
    :return: the distance from the token to the root
    """
    dist = 0
    while parser.get_head(token) != token:
        token = parser.get_head(token)
        dist += 1
    return dist