Posts Tagged Haiku Detector

Unintentional Haiku in the Mueller Report


Everyone’s talking about this Report on the Investigation into Russian Interference in the 2016 Presidential Election, so I dusted off Haiku Detector and looked for interesting haiku in it. A friend pointed me to a text version, though it’s not ideal for finding haiku; it has many superfluous hard line breaks, missing or superfluous spaces, and so on, which make it harder for Haiku Detector to tell where words and sentences end. There were also page and footnote numbers included in the text. Eventually perhaps I’ll read through it and clean those things up. Haiku Detector found 105 ‘haiku’ in 18752 ‘sentences’.

There were, of course, several similar to this:

Harm to Ongoing
Matter 26 Harm to
Ongoing Matter

of which I think this is my favourite:

Harm to Ongoing
Matter – H a r m to
Ongoing Matter

Some headings formed haiku:

P . 6(e) 7.
Interactions and Contacts
with the Trump Campaign

Other Potential
Campaign Interest in Russian
Hacked Materials

Others which seemed to make sense and stop at actual sentence or at least clause boundaries were:

They are talking to
us. -It is a lot of risk. –
Office of Putin.

“If you have any
questions, I will be happy
to help contact him.”

“We understand all
of the sensitivities and
are not in a rush.”

We also sought a
voluntary interview
with the President.

It’s all because you
recused. AG is supposed to
be most important

He’s a showboater.
He’s a grandstander. I don’t
know any Russians.

you know, this Russia
thing with Trump and Russia is
a made-up story.

But I feel so-I
tell you, I feel a little
badly about it.

“I don’t want to talk
about that. No, I don’t want
to talk about that.”

The president has
issued no pardons in this
investigation.

President said, “I
don’t talk about that now. I
don’t talk about that.”

“Manafort really
appreciates the support
of President Trump.”

“Paul Manafort’s a
good man” and “it’s a very
sad thing that happened.”

The Supreme Court has
applied that clear-statement rule
in several cases.

No statutory
term could easily bear that
specialized meaning.

I understand these
documents already have
been produced to you.

Some were just amusingly surreal because of artefacts in the text:

113
Corney recalled he did not
114

This is the worst thing
that ever happened to me.
“508

815
The President responded,
“I never said that.”

If you imagine that’s the real end of the sentence, and slang for ‘get out!’, it sort of makes sense:

Not telling you to
do anything. Dershowitz
says POTUS can get

I haven’t read the report, nor am I likely to know enough about the surrounding events and characters to fully understand it (nor would I be able to do much about it if I did, not having the right to vote anywhere), but maybe these pseudorandom pseudopoetic snippets will bring some comic relief for those who have. Perhaps I’ll run it through NastyWriter next.

, , , , , , ,

1 Comment

Unintentional Haiku in New Scientist’s Medical Frontiers: The Movie


How else can you stare at an empty canvas and see a work of art?I’ve made a new version of Haiku Detector. The main changes are:

  • Performance improvements
  • Tweaks to which haiku are identified when punctuation is pronounced differently depending on line breaks and other factors (this includes a workaround for the ‘all numbers pronounced as zero’ bug I found in the speech synthesiser.) In my test data the list of haiku identified is better now.
  • Bug fixes.

To celebrate the new release, I fed in the text from the latest New Scientist ‘Collection’ issue, on medical frontiers. The funniest haiku arose when the last sentence of one article joined up with the headline and byline of the next. For example, this looks like the tagline of a movie about an underappreciated superhero, fighting to save anti-vaxxers from diseases of yore:

They will not thank you.
Dan Jones FIGHTING INFECTION
Small shot, big impact

After the opening credits, we see our hero Dan Jones in his lab, and the subtitle announcing his first challenge.

DRUG: Chlorotoxin
SOURCE: Deathstalker scorpion
CONDITION: Cancer

His superpowers come, of course, from vaccines:

Some vaccines seem to
provide us with a host of
extra benefits

But not everybody is happy with that:

Several groups have been
trying to develop drugs
that block these signals.

These groups spread propaganda:

Half an hour or
so later, you’ll feel a lot
better. Or will you?

They work around rules:

“Because we use cells,
not field-grown plants, we don’t come
under the same rules.”

And they target humanity by zapping the very microorganisms they’re made up of. Here’s a quote from the evil mastermind:

There are more cells in
your body than there are stars
in the galaxy.

These cells can then be
killed using a laser that
penetrates the skin.

And just when Dan thought he had the solution, the problems compounded to the point of suspension of disbelief, precipitating a crisis. The mastermind had cooked up her own microbial minions:

Those microbes can be
in the environment or
a vaccine syringe.

To make matters worse,
there is a shortage of new
antibiotics.

The sequel, which may or may not be a Doctor Who crossover, features a heroine who will live forever:

“Just endless.” Helen
Thomson REGENERATION
Let’s get physical

Yep, it’s definitely a Doctor Who crossover. Here’s a quote from that movie:

“I’m the doctor. I’m
going to tell you what your
feelings really mean.”

She discovered that time, and specifically time travel, is the best cure for a broken heart:

If we can’t fix hearts
with stem cells there might be an
even better way

As the animal
was slowly warmed, it began
to return to life.

But however clever the TARDIS is, there’s one thing Helen Thomson isn’t sure she can do:

But can we ever
turn the clock back to a world
without HIV?

It turned out, weirdly enough, that the answer was in making sure there was enough shelf space for one’s awards. So she went home to Britain to save the Officers of the British Empire:

On her return home,
she applied those lessons in
British hospitals.

So far, two patients
have had OBEs, but neither in
a room with a shelf…

While we’re making sequels, let’s revive an old favourite, which never had any sequels:

The matrix holds a
dazzling array of future
possibilities.

But what is the matrix?

Normally, matrix
is harvested from human
or pig cadavers.

I guess you have to see it for yourself.

, , , , , , , , , , , ,

Leave a comment

Another Haiku Detector Update, and Some Observations on Mac Speech Synthesis


Screenshot of Haiku Detector

I subjected Haiku Detector to some serious stress-testing with a 29MB text file (that’s 671481 sentences, containing 16810 haiku, of which some are intentional) a few days ago, and kept finding more things that needed fixing or could do with improvement. A few days in a nerdsniped daze later, I have a new version, and some interesting tidbits about the way Mac speech synthesis pronounces things. Here’s some of what I did:

  • Tweaked the user interface a bit, partly to improve responsiveness after 10000 or so haiku have been found.
  • Made the list of haiku stay scrolled to the bottom so you can see the new ones as they’re found.
  • Added a progress bar instead of the spinner that was there before.
  • Fixed a memory issue.
  • Changed a setting so it should work in Mac OS X 10.6, as I said here it would, but I didn’t have a 10.6 system to test it on, and it turns out it does not run on one. I think 10.7 (Lion) is the lowest version it will run on.
  • Added some example text on startup so that it’s easier to know what to do.
  • Made it a Developer ID signed application, because now that I have a bit more time to do Mac development (since I don’t have a day job; would you like to hire me?), it was worth signing up to the paid Mac Developer Program again. Once I get an icon for Haiku Detector, I’ll put it on the app store.
  • Fixed a few bugs and made a few other changes relating to how syllables are counted, which lines certain punctuation goes on, and which things are counted as haiku.

That last item is more difficult than you’d think, because the Mac speech synthesis engine (which I use to count syllables for Haiku Detector) is very clever, and pronounces words differently depending on context and punctuation. Going through words until the right number of syllables for a given line of the haiku are reached can produce different results depending on which punctuation you keep, and a sentence or group of sentences which is pronounced with 17 syllables as a whole might not have words in it which add up to 17 syllables, or it might, but only if you keep a given punctuation mark at the start of one line or the end of the previous. There are therefore many cases where the speech synthesis says the syllable count of each line is wrong but the sum of the words is correct, or vice versa, and I had to make some decisions on which of those to keep. I’ve made better decisions in this version than the last one, but I may well change things in the next version if it gives better results.

Here are some interesting examples of words which are pronounced differently depending on punctuation or context:

ooohh Pronounced with one syllable, as you would expect
ooohh. Pronounced with one syllable, as you would expect
ooohh.. Spelled out (Oh oh oh aitch aitch)
ooohh… Pronounced with one syllable, as you would expect
H H Pronounced aitch aitch
H H H Pronounced aitch aitch aitch
H H H H H H H H Pronounced aitch aitch aitch
Da-da-de-de-da Pronounced with five syllables, roughly as you would expect
Da-da-de-de-da- Pronounced dee-ay-dash-di-dash-di-dash-di-dash-di-dash. The dashes are pronounced for anything with hyphens in it that also ends in a hyphen, despite the fact that when splitting Da-da-de-de-da-de-da-de-da-de-da-de-da-da-de-da-da into a haiku, it’s correct punctuation to leave the hyphen at the end of the line:

Da-da-de-de-da-
de-da-de-da-de-da-de-
da-da-de-da-da

Though in a different context, where – is a minus sign, and meant to be pronounced, it might need to go at the start of the next line. Greater-than and less-than signs have the same ambiguity, as they are not pronounced when they surround a single word as in an html tag, but are if they are unmatched or surround multiple words separated by spaces. Incidentally, surrounding da-da in angle brackets causes the dash to be pronounced where it otherwise wouldn’t be.

U.S or u.s Pronounced you dot es (this way, domain names such as angelastic.com are pronounced correctly.)
U.S. or u.s. Pronounced you es
US Pronounced you es, unless in a capitalised sentence such as ‘TAKE US AWAY’, where it’s pronounced ‘us’

I also discovered what I’m pretty sure is a bug, and I’ve reported it to Apple. If two carriage returns (not newlines) are followed by any integer, then a dot, then a space, the number is pronounced ‘zero’ no matter what it is. You can try it with this file; download the file, open it in TextEdit, select the entire text of the file, then go to the Edit menu, Speech submenu, and choose ‘Start Speaking’. Quite a few haiku were missed or spuriously found due to that bug, but I happened to find it when trimming out harmless whitespace.

Apart from that bug, it’s all very clever. Note how even without the correct punctuation, it pronounces the ‘dr’s and ‘st’s in this sentence correctly:

the dr who lives on rodeo dr who is better than the dr I met on the st john’s st turnpike

However, it pronounces the second ‘st’ as ‘saint’ in the following:

the dr who lives on rodeo dr who is better than the dr I met in the st john’s st john

This is not just because it knows there is a saint called John; strangely enough, it also gets this one wrong:

the dr who lives on rodeo dr who is better than the dr I met in the st john’s st park

I could play with this all day, or all night, and indeed I have for the last couple of days, but now it’s your turn. Download the new Haiku Detector and paste your favourite novels, theses, holy texts or discussion threads into it.

If you don’t have a Mac, you’ll have to make do with a few more haiku from the New Scientist special issue on the brain which I mentioned in the last post:

Being a baby
is like paying attention
with most of our brain.

But that doesn’t mean
there isn’t a sex difference
in the brain,” he says.

They may even be
a different kind of cell that
just looks similar.

It is easy to
see how the mind and the brain
became equated.

We like to think of
ourselves as rational and
logical creatures.

It didn’t seem to
matter that the content of
these dreams was obtuse.

I’d like to thank the people of the xkcd Time discussion thread for writing so much in so many strange ways, and especially Sciscitor for exporting the entire thread as text. It was the test data set that kept on giving.

, , , , , , , , , , , , ,

1 Comment

Unintentional Haiku Spoken in a Courtroom 241 Years Ago


When I discovered that the court proceedings of the Old Bailey were available online, naturally I had to see whether they contained any haiku. The archive is too huge to put into Haiku Detector all at once, so I just checked the ‘on this day in…’ link whenever I had time. The most haiku-rich I’ve seen so far was from a wounding case on 8 September 1773, which, now that I think about it, should not have appeared as an ‘on this day…’ link yet. I had to clean up the text a little first, to remove all the Q.s and speakers’ names. Here are some of the 55 haiku that were left.

These ones sound like some kind of metaphor for the fiddly final steps towards achieving goals, and the monsters that might demotivate us from climbing toward those goals, but which are secretly part of ourselves:

How far is it from
the upper step of the stairs
to the door itself?

Upon the landing.
Was the door within view of
you at that time?   Yes.

The General must
have seen you coming up two
or three steps at least?

How far had you got
up stairs before you saw Hyde?
Did you hear Hyde’s voice?

Who else was with you
there?  I cannot remember
any one but me.

Where did you wait while
Hyde went into the house?   At
the top of the street.

The world’s simplest riddle:

Yes. Where did you go
when you came into the house?
Into the entry.

And some more intriguing questions:

After Lee struck me:
the knife dropped upon the ground.
Was it by a blow?

Had he no blow with
the butt end of a pistol?
Not that I know of.

You say you knew the
General very well; do
you think he knew you?

When you came back what
part of the family did
you find below stairs?

In what condition
was the door when he fired
the second pistol?

What did he tell him?
That a parcel of fellows
were below with sticks.

Did you observe the
hole in the door case that was
made by the pistol?

Did you look through the
door to see the direction
the ball had taken?

Was the General
upon his legs or not? He
was upon his legs.

Some which sound like bloody massacres until you get to the last line:

I believe this is
the knife you was cutting the
bread and butter with.

Was James in the room
with you while you was cutting
the bread and butter?

Finally, a few which sound a bit dirty (or so I am told) if you have that kind of mind:

Read the rest of this entry »

, , , ,

Leave a comment

Unintentional Haiku from New Scientist on The Unknown Universe


I added some features to Haiku Detector so that it will find haiku made of more than one sentence, though I haven’t released the new version yet, since I’d like to release it on the Mac App store (even though it will probably still be free, at least at first) to see how that works, and to do that I’ll need an icon first. If you know anyone who can make Mac icons at a reasonable price, let me know. Meanwhile, New Scientist has released a new ‘collection‘ called The Unknown Universe, so why not mine it for haiku? The topics are ‘The early universe’, ‘The nature of reality’ (again), ‘The fabric of the cosmos’, ‘Dark materials’, ‘Black holes’, ‘Time’ (again) and ‘New directions’.

Let’s start at the very beginning, the early universe:

Can we really be
sure now that the universe
had a beginning?

At first, that seems like a terrible place to break the sentence to start a new line. But what if we pretend, until we get to the next line, that ‘Can we really be?’ is the whole question? Because that’s the real reason people wonder about the universe.

Now, here’s a multi-sentence one, which conveniently has a full sentence as the first line:

“We’re back to square one.”
Tegmark agrees: “Inflation
has destroyed itself.”

Deep. But what is this inflation thing, anyway?

Well, for one thing, it’s
not clear what actually
does the inflating.

Only then will we
truly know what kind of a
bang the big bang was.

“I am not convinced
the cyclic model is that
grander idea.”

But I think this is my favourite. There’s a monster at the end of this universe, and it’s making crosswords.

Cosmic monsters that
have survived into our times
also pose puzzles.

Now for the nature of reality:

“It pulls the rug out
from under us to prove a
theory right or wrong.”

Maybe we just need to look around us.

There is also down,
and, for that matter, left, right,
forwards and backwards.

Have we figured out what we’re looking for yet?

What it is, though, we
do not have the words or the
concepts to express.

Maybe E. L. James can help us figure it out:

“This experiment
allows us to see the shades
of grey in between.”

These ones are about the fabric of the cosmos:

“If you go by what
we observe, we don’t live in
space-time,” Smolin says.

We battle against
them each time we labour up
a hill or staircase.

“But where did the weak
primordial fields that seed the
dynamo come from?”

The same force that keeps
our feet on the ground also
shapes the universe.

I like this one for the contrast between the first and last lines:

The information-
loss paradox dissolves.  Big
questions still remain.

Here are some of the ‘dark materials‘ haiku, about dark matter and dark energy:

The discovery of
dark matter would be the find
of the century.

I love how this contrasts ‘discovery of’ with ‘find of’; I didn’t notice that in prose form.

We still don’t know what
it is. It is everywhere
and we can’t see it.

That opens the door
to a dazzling array of
possibilities.

This chase through space will
be thrilling, but the quarry
may still elude us.

“It seems like a long
shot,” he says. But others are
being won over.

“But we don’t see a
fifth force within the solar
system,” says Burrage.

Though maybe the array of possibilities isn’t so dazzling after all:

It is limited
to perhaps three things. First, dark
energy pushes.

There are only two haiku about black holes, but one of them sounds like an idea Dan Brown might write about, probably without first reading New Scientist:

A BOMB made out of
a black hole is a rather
unsettling thought.

And the other sounds like it belongs on an episode of Doctor Who:

One of them will have
to blink if this paradox
is to be undone.

There are no more haiku on time, but luckily there were some in the last collection. I love this one about new directions, though:

Put that to many
physicists, and you will get
a grumpy response.

Ah, those physicists, always hopeful:

“Historically, these
things have usually led
somewhere,” says Davies.

They even have a solution to that ‘we still don’t know what it is’ problem from earlier:

“We don’t know what it
is so we have to give it
a name, a symbol.”

After that, it gets
a lot more speculative,
but here’s the best guess.

But they’re not that confident about it:

There are also good
reasons to think it is an
unwarranted one.

Paths to a theory
of everything will become
even more winding.

For instance, it could
decrease with time, or even
become negative.

Infinity makes things even more difficult:

INFINITY. It
is a concept that defies
imagination.

But it is at the
big bang that infinity
wreaks the most havoc.

The first line of the first infinity one reminds me of a CERN friend’s recipe for gravity: you just put ‘it’ in gravy.

, , , , , , , , , , ,

Leave a comment

Unintentional Haiku from New Scientist, on Shakespeare and Stuff


I’m still behind on New Scientist, so I’m now reading the issue which has a special feature on Shakespeare. It seemed like a good issue to look for poetry in. Here are the haiku that Haiku Detector detected in the articles about Shakespeare. The first is a strategically-syllabicised book promo:

His book The Science
of Shakespeare is published this
month (St Martin’s Press)

The next has a supporting quote from the Bard himself:

Supporting quote: “If
sack and sugar be a fault,
God help the wicked.”

but this one is my favourite:

Most of all he swings
between moods superbly high
and desperately low.

That doesn’t seem like enough stuff for a blog post. Luckily, the issue just after the special issue that I already found haiku in has a feature on ‘stuff’, so here’s the only haiku from that:

His leather backpack
is today’s bag to haul our
essentials around.

In case it’s still Star Wars Day when you read this, you might want to check out my post from last Star Wars Day featuring a video in which I read my poem about not having seen Star Wars.

, , , , , , , ,

Leave a comment

Unintentional Haiku from New Scientist, on Self, Sleep, and Death


Following on from the posts on reality, existence, and God and consciousness, life, and time, here are the unintentional haiku that Haiku Detector found in the last three sections of New Scientist’s special issue with the ‘big questions’: the self, sleep, and death. The ‘self’ section has a haiku in an image caption:

The self may be a
necessary illusion
(Image: Darren Hopes)

I suppose it could make sense if somebody named Darren hopes that the self is an image:

The self may be a
necessary illusion
(image, Darren hopes)

The others are from the main text:

But we surely still
have the same self today that
we had yesterday.

For most people, most
of the time, the sense of self
is seamless and whole.

These ones are about sleep, perchance about dreaming:

Our emotional
undercurrents seem to be
the guiding force here.

This one requires ‘2008’ to be pronouned ‘two thousand eight’, not ‘two thousand and eight’:

In 2008,
hints emerged that these might be
the deeper stages.

The fountain of youth
may have been as close as our
bedrooms all along.

So it’s puzzling that
we still don’t really know why
it is that we sleep.

And finally, one on the final sleep, death:

When the risk is slight,
mild concern may be all that
is appropriate.

That’s all from that special issue of New Scientist, though the latest issue is dedicated to Shakespeare, so I hope to find some poetry in it. If there’s anything else you’d like me to mine for haiku, let me know!

While I was writing a poem a day, there would be times when I’d just feel like writing prose, for a break. I was hoping that this prose pressure would build up and I’d write something amazing when NaPoWriMo ended. Now that I’m trying to prioritise writing a short story for a competition, poems are trying to force their way out. So I still could manage 30 poems in 30 days, but I’m not going to pressure myself to post them by each midnight, and I won’t feel bad about posting found haiku when I don’t have a poem ready.

, , , , , , , , ,

1 Comment

Unintentional Haiku in Time Cube


I’m not sure if I’ll keep up the daily poems for NaPoWriMo for the rest of the month, because I remembered that the deadline for a short story contest I plan to enter is also at the end of the month, so I’ll need time to write something for that. But today’s What If reminded me of the hilariously incoherent ‘Time Cube‘ website, and I wondered if there were any unintentional haiku in it. I ran Haiku Detector on it, and I found these ones on the first page:

I have so much to
teach you, but you ignore me
you evil asses.

Humans ignore their
4 corner stages of life
metamorphosis.

All 4/24
hour days occur within
1 Earth rotation.

I have created
simultaneous 4 day
rotation of Earth.

Your God claimed to have
created a single day
rotation of Earth.

Singularity
educated humans are
not intelligent.

I like the first one best. I hadn’t read this far before, but it turns out the second page has some weird statements supporting racial segregation on it, so if you’re likely to be bothered by ridiculous-sounding racist statements by a crackpot, read no further.

Read the rest of this entry »

, , , , , ,

Leave a comment

Unintentional Haiku from New Scientist, on Consciousness, Life, and Time


I’m going out tonight and won’t have time to finish writing a poem for NaPoWriMo, so here are the haiku that Haiku Detector detected in the next three topics of New Scientist’s special issue with the ‘big questions’. I posted the unintentional haiku on reality, existence, and God last week.  This seemed like a good place to find interesting unintentional haiku, so I ran Haiku Detector over the first three sections. Perhaps I’ll do the rest on later Saturdays, to give myself a weekly break during poetry writing month.

There’s only one unintentional haiku on the subject of consciousness, but it’s a good one:

You may think you know
the reasons, but they could be
a work of fiction.

Two about life:

These discoveries are
bringing an old paradox
back into focus.

There is a simple
way to get huge amounts of
energy this way.

One of these days I’ll add in some linguistics-based heuristics or a learning algorithm to rank the haiku; haiku lines ending in prepositions are often not as good, for example, and splitting the adjective from the following noun is a little weird too.

The section on time has the most and best haiku. This pleases me, because the largest text I tested Haiku Detector on when I first wrote it was the forum thread about the xkcd Time comic. There were a lot of haiku in there, and pointing them out encouraged people to write more.

So clocks tell us that
time is inextricably
linked somehow to change.

Now, more than ever,
we have to face up to our
ignorance of time.

If time’s arrow is
not in the laws of physics,
where does it come from?

Why do human brains
only remember the past
and not the future?

WE ALL, regardless
of our cultural background,
experience time.

Traditionally they
have lived by small-scale farming,
hunting and fishing.

Nonetheless, we could
do some interesting things with
our own time machine.

On the subject of time, I’d better hurry up and go out. Tune in next week for New Scientist’s unintentional haiku on the self, sleep, and death.

 

, , , , , , , , , , ,

3 Comments

Unintentional Haiku from New Scientist, on Reality, Existence, and God


I’m not only behind on poems, I’m also behind on reading New Scientist magazine, so I’m just starting on a special issue with the ‘big questions’ with articles about reality, existence, God, consciousness, life, time, self, sleep, and death. This seemed like a good place to find interesting unintentional haiku, so I ran Haiku Detector over the first three sections. Perhaps I’ll do the rest on later Saturdays, to give myself a weekly break during poetry writing month.

There’s only one unintentional haiku on the subject of reality:

Afterwards, we map
the locations of all the
thousands of flashes.

These three are about existence:

“Small simulations
should be far more numerous
than large ones,” he says.

Sadly that means you
will never be able to
meet your other you.

A few researchers
even think it could happen
in the next decade.

That last one works for many great scientific quests, at any time. Here are some about God… or… Santa?

More interesting still
was a second version of
the experiment.

Santa knows if you’ve
been bad or good but does he
know all that you do?

Because of this, they
are highly susceptible
to false positives.

I wonder what the second version of God’s experiment would be like.

, , , , , , , , ,

7 Comments

%d bloggers like this: