def end_current_entity(previous_label_without_bio, current_entity_length,
    new_labels, i):
    """
    Helper function for bio_to_bioes
    """
    if current_entity_length == 0:
        return
    if current_entity_length == 1:
        new_labels[i - 1] = 'S-' + previous_label_without_bio
    else:
        new_labels[i - 1] = 'E-' + previous_label_without_bio
