def end_words(sonnet):
    for i in range(len(sonnet)-1):
        while sonnet[i][-1] in banned_end_words:
            if any([sonnet[i][-1], sonnet[i+1][0]] == vw[j:j+2] for j in xrange(len(vw)-1)):
                break
            else:
                sonnet[i] = sonnet[i][:-1]
        else:
            pass
    return sonnet
dataset/ETHPy150Open rossgoodwin/sonnetizer/sonnetizer_n.py/end_words/original