I wrote an extremely simple python program that orders lines of text by the length of each word in the line.
1 2 3 4 5 6 |
import sys for line in sys.stdin: line = line.strip() words = line.split(" ") words.sort(key=len) print " ".join(words).lower() |
I ran The Metamorphosis through it:
gregor’s flesh, lodged remove no-one apple dared the it so in to
suffered reminder remained injury. visible there had his he of as a
condition serious seemed month, there than more his and for it a
current despite gregor, father remind enough that even his his to
revolting treated member family could form, not who was and sad be a
contrary, family enemy. there duty was the to as on an as a a
revulsion patient. patient, swallow just and him for any be to be to