def token_start(token, ending, start_min_length):
    """Given an ending, returns the start of a token if possible"""
    if token.endswith(ending) and len(token) > len(ending):
        start = token[:-len(ending)]
        if len(start) >= start_min_length:
            return start
    return None