def get_sent_num(text, sent_dict):
    """Return the sentence number stored in the dict.

    The sent_dict is a {text:sent_num} dictionary. If the sentence text
    is not in the dictionary, the function will add it with a sent_num value
    corresponding to the current length of the sent_dict.
    """
    if text not in sent_dict:
        sent_dict[text] = len(sent_dict)
    return sent_dict[text]
