def pos_ok(token_pos, token_index, pos_limit):
    """If there is a pos_limit, check if token has correct part of speech. Pass all tokens otherwise."""
    if pos_limit:
        return token_pos[token_index] in pos_limit
    else:
        return True