from typing import List
from typing import Tuple


def _get_token_spans(sent: str, tokens: List[str]) -> List[Tuple[int, int]]:
    """for each token returns it's span in a sentence
    Args:
        sent (str): white-space delimited sequence of tokens
        tokens (List[str]): substrings of sent (sent.split())

    Returns:
        List[Tuple[int, int]]: list of token spans
    """
    tokens_pos = []
    i = 0
    j = 0
    while i < len(sent):
        assert sent[i : i + len(tokens[j])] == tokens[j], (
            sent[i : i + len(tokens[j])],
            tokens[j],
            sent,
            tokens,
        )
        tokens_pos.append((i, i + len(tokens[j])))
        i += len(tokens[j])
        while i < len(sent) and sent[i].isspace():
            i += 1
        j += 1
    return tokens_pos