def get_start_index(token_num, tokens, text):
    """Get the starting char index of a given token_num in text.

    The starting char index corresponds to the first char index of a token
    identified by its token_num, given a text tokenized in a list of tokens.
    """
    start = 0
    for token_index, token in enumerate(tokens):
        while text[start] != token[0]:
            start += 1
        if token_index == token_num:
            return start
        start += len(token)
