for word in words[1:]:
    if i & 1:
        r.append(word)
else:
    r[-1] += ' ' + word
i >>= 1
yield r
for part in partition('The really fast dog.'):
    pass
Split a string into all possible ordered phrases