News for hackers. Stuff that matters.
Re:Why Anti-Authoritarians are Diagnosed as Mentally Ill (2012) by csense on Thursday May 09, 2013 @10:47PM (#5684265)
Free verse seems silly and pointless. So I wrote a trivial program to turn prose into free verse:

    import random

    def poem(text, p_break=0.5, seed=1234):
        rand = random.Random(seed)
        result = []
        for w in text.split():
            result.append(w)
            if rand.uniform(0.0, 1.0) < p_break:
                result.append('\n')
            else:
                result.append(' ')
        return "".join(result)

    print poem("This is a poem written by a program.  It is not really a poem because it does not rhyme, it is some weird thing called free verse, which is a poem that does not rhyme.", p_break=0.1)
Here's the output:

    This is a
    poem written by a program.
    It is not
    really a poem because it does not rhyme,
    it is some
    weird thing called free
    verse, which is a poem that does not rhyme.
Re:Why Anti-Authoritarians are Diagnosed as Mentally Ill (2012) by JonnieCache on Saturday May 11, 2013 @06:09AM (#5690231)