def _char_to_token_offset(text: str, mention: str, char_offset: int, text_tokens: List[str]) -> int:
    char_index = token_index = 0
    while (char_index < char_offset):
        if text[char_index:].startswith(text_tokens[token_index]):
            char_index += len(text_tokens[token_index])
            token_index += 1
        else:
            char_index += 1
    return token_index
def _char_to_token_offset(text: str, mention: str, char_offset: int, text_tokens: List[str]) -> int:
    char_index = token_index = 0
    while (char_index < char_offset):
        if text[char_index:].startswith(text_tokens[token_index]):
            char_index += len(text_tokens[token_index])
            token_index += 1
        else:
            char_index += 1
    return token_index