Add punctuation as needed

def punctuate(current_text, new_text, add_punctuation):
    """ Add punctuation as needed """
    if add_punctuation and current_text and not current_text[-1] in string.punctuation:
        current_text += '. '
    spacer = ' ' if not current_text or (not current_text[-1].isspace() and not new_text[0].isspace()) else ''
    return current_text + spacer + new_text