Forgot your password?
typodupeerror
Programming IT Technology

Can You Create An Intelligent Haiku Generator? 211

Posted by timothy
from the must-refer-to-season dept.
BlueCalx- writes: "dotcomma has created a new programming contest: this time, to determine whether or not someone can create a program that can automatically parse an RDF file and generate a haiku based on its headlines or stories. Slashdot users such as 575 have essentially been doing the same thing for months: now, it's time to see if a computer program can do the same thing *g*. After witnessing the success of the AI Bots challenge a few months ago, it'll be interesting to see if a program like this is possible." Anyone who can generate intelligible, germane haiku from headlines without human intervention has my respect -- it's a lot thornier than it sounds.
This discussion has been archived. No new comments can be posted.

Can You Create An Intelligent Haiku Generator?

Comments Filter:
  • by Anonymous Coward
    haiku es fácil
    si usamos español
    usted conviene?

    (haiku is easy
    if we utilize spanish
    do you acquiesce?)
  • by Anonymous Coward
    thank god i didn't go to cal-tech.
  • by Anonymous Coward
    Would Basho approve?
    I have written four stanzas.
    Moderate me up.

    Haiku by machine.
    Unfeeling silicon chip.
    Basho turns in grave.

    Clever perl script hacks.
    Create poem making code.
    Basho comes around.

    Basho buys PC.
    Installs Linux and writes code.
    Source is poetry.

    Elegant program.
    Basho's work makes Bill Gates cry.
    GPL Haiku.
  • by lars (72)
    Post only Haiku
    Get moderated to 5
    Better than 'first post'
  • by whoop (194)
    Who uses Perl now?
    Python is da bomb, for sure.
    Die Perl, die, die, die!
  • Please to let me submit a patched version of this:


    Computer haiku:
    Poetic rhythm down pat,
    But lacking a soul.

    --
  • by emerson (419)
    Damn it all to hell.
    Moderators have mercy.
    Meant to drop plus-one.



    --
  • by MassacrE (763)
    Intelligent haiku??
    DUDE, I have had one of these
    for months, no - YEARS now
  • I already created 575. I'm working on making an intelligent one now though.
  • Argh! No line breaks here.
    Unintelligable mess.
    Preview is your pal.
  • Verbal Diarrhoea
    I cannot count syllables
    Six on the first line :(
  • Then there's this form (bad example hacked in a few seconds, my poetry professor would gag on this):

    Written words on a bathroom wall,
    staring at the letters,
    ink stained tiles beg you to call.
    You scratch the number
    in your palm.

    Get to a phone and call her right now.

    See if you can guess the form. The content is a clue.

    LetterJ

  • I can't think of any examples right now, but I'm sure plenty will come up next time I watch a wildlife or 'geography' type programme featuring animals or some ancient tribe. Which will probably not be for a while :-)
  • Sorry, could we have a translation?

  • by stirge (12062)
    Since when are Haiku's Intelligent?!
  • by Paradox (13555)
    This challenge is great, but too bad I have no skills, good luck to entrants! Err, um, okay, nevermind, that sucked, I'll uh, go back into my cave now..


    __
  • by mutende (13564)
    157 +++ do i = 1 while tem.i ""
    8 +++ dummy = InitVocab()
    Error 34 running "/home/mattc/bin/Haiku.rexx", line 157: Logical value not 0 or 1

    Oops -- HTML-formatting ate some <> operators. :-(

    I've put a copy of the original script here [magnetic-ink.dk]...


    --

  • That's cool. Small web, huh?

    While, because of the non-traditional subject matter, these would probably be considered senryu (which has its own long tradition), I posted the three that I thought best approached the spirit of haiku.

    For what it's worth, you can tell her that.
  • How about "I caught two fish"? Or "I sheared two sheep"? I don't think there's anything horribly wrong with the singular and plural of a word in English being the same. Uncommon, yes, but not bad.

    It also seems to me that English loanwords try to preserve spelling first and worry about pronunciation later; also, more recent loanwords are pronounced closer to their foreign pronunciation.* This leads to haiku/haiku, at least for the time being. Once a loanword's been in common use for a while, the English plural appears. Then, the -s becomes preferred. Finally, the foreign plural is dropped in English. Some examples from m-w.com:

    • Foreign only: haiku, alumnus
    • Foreign then English: radix, cactus, stylus, ninja
    • English then foreign: index, appendix
    • English only: soprano
    With that being said, however, you'll be right in the long run. Some dictionaries (American Heritage, for one) already have "haikus".

    I personally have no problem with "haikus" -- actually, I was going to use "haikus" in post 54 [slashdot.org] until I remembered that Spanish adjectives reflect number. I was just going for the (+1, Funny) in my "Because!" post -- that song cracked me up, for some reason.

    Enough rambling for now. :^)
    --Kimble

    * At least Standard American English does. Your kilometrage may vary. For example, SAE speakers rhyme "Paris" with "ferrous", but rhyme "Versailles" with the first two syllables of "bursitis" (i.e. "the French way, or close enough").

    --

  • I personally haven't noticed plural dropping in the southeastern US. Do you have any other examples? "Antelope" has been used as a plural for quite a while on this side of the pond:
    Home, home on the range

    Where the deer and the antelope play
    Where seldom is heard a discouraging word
    And the skies are not cloudy all day
    -- a popular poem/folk song from 1873 (it's clear from the context of the song that they're referring to multiple antelope)

    To be honest, though, I'm a believer in letting someone speak however they want as long as their message is conveyed. (Uh-oh! I used "they" as a 3rd person singular neuter pronoun! Call the grammar police!) I won't begrudge you your "antelopes" and "haikus". They just aren't what people (apparently) commonly use.

    --

  • Because! [berkeley.edu]
    --
  • include season.h
    might help you qualify it
    as a true haiku


    Jim in Tokyo
  • if (defined $Haiku) { croak if not defined $threelines; require $seasoning; }
  • if (defined $Haiku) {
    croak if not defined $threelines;
    require $seasoning; }


    (yes, do use that preview button! :-)))
  • Surely it's English....talk about cultural insensitivity....
  • After witnessing the success of the AI Bots challenge a few months ago, it'll be interesting to see if a program like this is possible.

    I'd hardly call their AI Bots contest a success; far from it, as a matter of fact. The entire contest died on the launching pad---they generated a fair amount of excitement, then proceeded to completely drop the ball.

    Based on that precedent, while this haiku generator contest is an interesting idea, I don't feel inclined to join in, based on my expectation that the dotcomma guys will forget about the whole thing in a week or so.

    dotcomma contest
    flurry of activity
    soon is forgotten


    --
  • Nope, the best I have is my nifty random password generator... Complete with command line customization of what characters to include and password length...

    Can't help on this project...
  • Damnit! I knew I should have left out the --use-dictionary-word option!
  • Also, remember the whole 5-7-5 thing comes from Japanese, a language very different from our own.

    I remember an Isaac Asimov story (one of the "Tales of the Black Widowers") where it was argued that the limerick is to English what the haiku is to Japanese. Japanese is a tonal language, and fixed patterns of syllables stand out very well. It's also mildly difficult but not impossible to assemble coherent phrases with fixed syllable-patterns in Japanese.

    English, on the other hand, is not a tonal language, and has a grammar that consists mostly of a collection of exceptions. Patterns of syllable-stress and rhymes stand out. And it is similarly mildly difficult but not impossible to form coherent phrases with fixed meter and rhyme.

    Haikus don't stand out in English very well, and from what I gather it's (a) difficult to construct a limerick in Japanese and (b) doesn't sound terribly unsual when you do.

  • Can it not be so?
    Slashdot Story on haiku
    Self-fufilling post

    Personally, the only two haiku I'm really proud of are on the Olestra/Olean Haiku page [cmu.edu] and are thus:

    How did Zappa know?
    'Voodoo Butter Underpants..'
    Olestra vision.

    .. and ..

    Olestra Facists;
    They have tainted my Fritos!
    Fudgie underwear...

  • by beppu (32422)
    Coy.pm would be a good start. Damian Conway [cpan.org] is my Perl hero.
  • Actually, most the the "haiku" I've seen here are senryu-- humorous or satiric poems dealing with human (well, computer :) affairs.

    The best book I can think of to undo the damange done by the 5-7-5 haiku pundits is:

    The Haiku Handbook - How to Write, Share, and Teach Haiku
    William J. Higginson (with Penny Harter)

    Or a few related URL's:

    http://empirezine.com/haiku/1.htm
    http://www.ahapoetry.com/wildonji.htm
  • You forgot the seasonal component.

    Microsoft broken
    Not quite yet but maybe by
    Summer after next

    Bob.
  • How about haiku mission statements

    Best distribution.
    Linux with office apps on desktop.
    Kick microsofts ass.

    Bob.
  • D'oh office is 2, make that

    Best distribution
    with office apps on desktop.
    Kick microsofts ass.

    Bob.

    PS,

    Preview should spell check.
    syllable count would also help
    575 wannabes.

    :-)

  • Unquoted smiley
    Indicates the irony
    you misunderstood.
  • Some Haiku express
    Depths of insight and beauty
    But this one does not

  • No, the plural is haikus. Or wait, maybe it's haiki, no, no it has to be haikii.

    (this is all in reference to an earlier /. discussion about the plural of virus)
  • by Anonymous Coward
    This reminds me of something I saw at thinkgeek.com. It said "Go away, or I'll replace you with a very short shell script." 575 had better watch his back!
  • by emerson (419)
    (*grin)

    That's damned amusing.
    I could have taken offense.
    But AC's kick ass.

    --
  • Haiku appropriate
    From one who will emulate
    David Brin's dolphins
  • I figured Perl would be a good language for writing a Haiku generator, so I popped over to CPAN to see what modules could help count syllables. Ah ha. Lingua::EN::Syllable

    Read the docs:

    "It guesses correctly about 80-90% of the time,
    but it's smaller and faster than a dictionary
    lookup. So you can't really use it for
    writing random haiku."

    Dang, these guys are _way_ ahead of me!!

    Baz

  • Haiku may not have a separate plural form in Japanese, but that is no reason for it to do the same in English.

    I don't know any Japanese but I'd guess that in a typical sentence, the number (singular or plural) of the word haiku can be worked out from the context. But English doesn't always have that context, and English speakers are used to just having the pluralness of a word thrust in their face. It doesn't sound right to use exactly the same word for singular and plural; English just doesn't work like that.

    There is a similar situation with pronunciation of words borrowed from French. Although French nouns do change their spelling in the plural form, the pronunciation is usually the same. But you can instantly tell whether it's singular or plural by looking at the article. For example, 'objet' and 'objets' sound exactly the same most of the time, but you have 'un objet' and 'des objets'.

    So what do we do when borrowing these words for use in English? Take cafe for example (which should have an acute accent, but Slashdot's HTML posting doesn't seem to allow them). Most people pronounce this the French way, or close enough, as 'caffay'. (We'll ignore caffs for this discussion.) But although the singular in English sounds like the French word, the plural cafes is prounounced with an s on the end, because 'the' and 'a' do not indicate number as their French counterparts do. People do not say 'I walked past two caffay', because that would sound silly.

    To say 'I wrote two haiku' sounds just as silly. English is not Japanese, so there's no reason for it to follow Japanese grammar.
  • We all know about sheep and fish, and people just put up with them. But it's a bad idea to introduce yet more special cases.

    As for the trend being towards -s plurals in the long run, what about words like 'antelope', which used to have a plural form but don't seem to any longer? It looks to me as if people are pretentiously discarding the plural for any vaguely foreign-looking word.
  • What's going on with plurals here? Surely the plural of haiku is haikus?

  • A channel I go to has a haiku bot. It is not entirely computer-generated, but it is pretty fun. Here's how it works.

    The bot's owner collects semi-interesting 5- and 7-syllable quotes and stores them in a database. Then, when someone types .haikux in the channel, the bot spits out three random lines in the appropriate order. It is more often interesting than not, and sometimes very amusing.

    The channel's name starts with an R, it's on EFNet, and is currently -s and -p. Good luck! :)

    --

  • Rainy Seattle
    Steeled for early winter.
    Hello Canada!

    K.
    -
  • Neither of these are haiku...
    #!/bin/perl5
    print 'the sound of shebang' or '#!'

    if quote is pronounced, the second line is 8 syllables:

    Doh! That was a last second typo; I should have cut/pasted from my xterm. :-( So that should have been:

    #!/bin/perl5

    print 'sound of shebang' or '#!'

    Thanks for pointing this out; sorry for the silly error.

    The second line on this one has too many syllables already: [snip scansion] unless you're from the midwest and pronounce "fire" like "far".

    Well, this is being *posted* from Missourah...but even though I'm not from the Midwest, "fire" is basically monosyllabic in my dialect. So I reject your criticism here. Hah! :-)

    In any case, both are well-formed perl, and now also proper haiku. Thanks for your help.

  • Interesting... if "include season.h" is 5 syllables, does that mean that you don't pronounce the dot? I've always said it, "Include season DOT h", not "Include season h"...

    I agree with you here, but for the sake of the Perl as Haiku Movement, I think we need a definitive ruling on the pronunciation of other punctuation. Especially #!, ', ", and ;. I think it's only fair to suggest that perl as haiku be executable, like other perl poetry, but I'm less sure that we can all agree on how to pronounce it correctly.

    So is this a haiku?

    #!/bin/perl5 print 'the sound of shebang' or '#!'

    Obviously, I pronounce the first line "shebang bin perl five", but I'm not an authority on this. I'm a bit squeamish about pronouncing "quote", though, although that would be consistent. If ' is silent, then the haiku could be:

    #!/bin/perl5 print 'shebang! a firecracker?' or die 'like #!'

    The seasonal reference is to midsummer fireworks (duh...).

    Dang; where's Tom Christiansen when you really need him here. :-(

  • Good idea. Let's go for serious poetry overloading, though, and give large additional bonuses for haiku that are not only self describing, but include anagrams and palindromes as well. :-)

    Further, embedded Carrollian logic puzzles/references, puns, or other forms of wordplay would each double the score. (I'll think about this tonight - I haven't tackled a really clever word puzzle since I unravelled the new answer to "Why is a Raven like a writing desk?" [lewiscarroll.org]

    Of course now we're well beyond anything computers are likely to do in our lifetimes, so this will be a warmware competition to write palindromic, anagrammatic(?!), pun-filled, self-describing haiku riddles. Whoa... dain bramage. (Yeah, Spoonerisms should count, too!)

    Or, this could just devolve into something like Finnegan's Wake, which would require artificial insanity rather than (or is that in addition to?) artificial intelligence - the former is probably much more difficult to produce... ;-)

    Seriously, it would be really fun to see how many of these aspects one can cram into the haiku form, creating true meta-haiku.
  • glug, glug, burble, stir
    the sound of coffee pouring
    Maxwell House morning
  • This one clearly doesn't satisfy the desired criteria, but it lets me use a pun I've been dying to use all week:

    Feds with autos storm
    Sieze cow'rin boy in closet
    It's OrwElian


    And yes, cow'rin ("cowering") is legitimately two syllables on the authority of Rrrabbie Burrrns, [rabbie-burns.com] who probably never wrote a haiku in his life, although apparently, there is a Scottish haikuist(?) [braveheart.co.uk] of some note.
  • Yes, there is generally a turn at the end (more of a spinning outward), and yes, there is traditionally a word indicating a season (kigo), but not just the words fall or spring, there were whole catalogs of words with their traditional seasonal indication. Cats, for instance, indicate a haiku about Spring.

    The conventions governing the content of Haiku come from the its origin as a starting point for linked poetry (renga). Linked poems were like a medieval Japanese drinking game. These would start with a 575, to be completed by the next poet with a 77 and a 575, and so forth. Like all games, it had to have rules, and they were elaborate. Each new link had to take the poem in a direction agreed upon by the contestants based on a predetermined sequence or algorithm (e.g. Winter/Winter/Nonseasonal/Moon/Autumn ...), which eventually were codified into standard forms.

    The initial 575 verse of the Renga was called a Hokku. To be functional, it had to fit into one of the standard forms (e.g. refer to a season); to be good, it had to set up a twist the next player would have to build upon. Making a good starting place became an art form in itself, and people began to anthologize good Hokku -- thus the origin of the Haiku form.

    It would be really cool to write a program that would "play" renga against a human co-author!

    Japanese poetry liberally uses not only standard word lists, but liberally allusions to well known prior works in longer forms. An image, like dampened sleeves or straining to see through falling leaves, carries a well known meaning established in poems stretching back over a thousand years (in this case both images imply tears). This is like the difference between programming everything in one routine, and having a well staocked standard library. Thus, I suspect Japanese authors can squeeze a lot more information into a 575 than an English author can. Also, the 575 pattern sounds utterly different in Japanese than it does in English. In other words, an English Haiku is hardly a Haiku at all. Nonetheless, there have been some English poets who've had pretty good success with the form. My favorite is Richard Wright (best known for writing Native Son). Here is a sample:

    With a twitching nose
    A dog reads a telegram
    On a wet tree trunk.

    And another:

    Burning autumn leaves,
    I yearn to make the bonfire
    Bigger and bigger.

  • by w3woody (44457)
    with a sledgehammer
    computers compute
    words are delicate
  • smart, germane haikus
    is software up to the job?
    oops, buffer overflow
  • We didn't forget about them. We are going to meet to determine what to do about them shortly, look for news on the page.
  • A perfectly dynamic haiku generator, suitable for every situation...

    printf("This Haiku was made\n
    In response to your query.\n
    Have a nice season.);

    Where's mah prize?
  • Posting some haiku

    would be too predictable
    but I can't help it

    I don't suppose the on-the-fly error haiku generated by ...I forget the name of the Perl module... doesn't count for this does it? Too bad, that's some funny stuff -- especially the abstract which itself is written in 5-7-5 form. I'd post a link but forget where it is offhand -- try CPAN I guess...



  • klicken sie hier [slab.org]

    Everyone (incl me) seems to be posting favorite haikus (what is this, an excuse or something? :), but I'll post a *picture* of one of my favorites instead! hahaha



  • I think the best description I ever heard of the effect of a haiku compared it to a spark plug. It might have been in D.T Suzuki, but I can't recall. The first two lines and the bottom line form the two terminals of the electrode. The experience or realization that comes of it is the spark that jumps between the gap. So the last line often seems at best tangentially related to the first two (certainly not a continuation of the idea). The whole field of haiku is very tightly bound with the Zen tradition; great for starting the ubiquitous flame wars about who's enlightened on alt.zen.

    "Sweet creeping zombie Jesus!"
  • If I've got the distinction right, a haiku is a poem about nature, whereas a metrically similar poem about human nature is called a "senryu."

    Yours WDK - WKiernan@concentric.net

  • In most dictionaries words are already divided into syllables and annotated with their grammatical roles. To write a good haiku generator, one needs to add a list of associations to each word. Then have a (simplified) haiku grammar that goes like this:

    haiku ::= sentence sentence sentence
    sentence ::= noun-group verb-group
    noun-group ::= noun | adjective noun-group | ...
    verb-group ::= verb | adverb verb-group | ...

    and start generating. Make sure that syllable count is right, and words are more or less associated with each other. This is of course easier said than done.
    --

  • From m-w.com:

    Main Entry: haiku
    Pronunciation: 'hI-(")kü
    Function: noun
    Inflected Form(s): plural haiku
    Etymology: Japanese
    Date: 1902
    : an unrhymed verse form of Japanese origin having three lines containing usually 5, 7, and 5 syllables respectively; also : a poem in this form usually having a seasonal reference
  • damn you cgi
    I wanted first post and you
    only gave me third
  • Haiku appropros
    From one who will emulate
    Brin's clever dolphins

    -c.
    --

  • 10 PRINT "This is a"
    20 PRINT "Haiku program!"
    30 GOTO 10

  • RDF Haiku?
    segmentation fault: core dumped
    damn you, Borland C

  • you *can* create a haiku generator. i assume that wouldn't be that difficult. Much like assembling a group of "stealth squirrels"

    however, i haven't even seen that many living, breathing, human beings create good haiku. in non-english graduate student terms...just because it rhymes doesn't mean it's poetry. (if you are going to flame me with "hey asshole, haiku don't have to rhyme" then please smack yourself, and tell your head it's from flux.

    Idunno, this is a neat little programming assignment. Create a program that generates haiku, but i'm not sure that it's anything more than that. Something on the order of a programming assignment for CS students who got an %88 on their "game of life" homework. There's no way (at least not any time soon) that a program is going to come up with any meaningful haiku any time soon.

    It may be 5-7-5, but it's sure as hell not going to be poetry.

    when i look into
    the grasshopper's eyes, i see
    the mountains behind



    FluX
    After 16 years, MTV has finally completed its deevolution into the shiny things network
  • This guy really rocks
    But his job will be replaced
    By a small shell script
  • Tengo que decir
    Lamentablemente, no
    Por qué lo crees?

    (I am forced to say
    Lamentably it's not so
    The last line's a bitch!)

  • include season.h
    might help you qualify it
    as a true haiku

    Interesting... if "include season.h" is 5 syllables, does that mean that you don't pronounce the dot? I've always said it, "Include season DOT h", not "Include season h"...

    Something to ponder...

  • Moderators, hark!
    You should give the above post
    Karma as follows:

    Plus one, insightful
    Plus one for humor as well
    Minus one, BASIC

  • But then AOL
    Created the Septemb er [jargonfile.org]
    That never ended.

  • The start of senryu [5-7-5 poems, of which haiku is a subclass]
    Was in Japanese, which is
    As bad as Spanish.

    Ever watched subtitled anime and noticed how darn _fast_ those people talk?

  • Word macro virus Distributes memes randomly Source code for the mind
    "The axiom 'An honest man has nothing to fear from the police'
  • Hackish tradition
    Write code to do nifty things
    Beats doing real work

    Haiku program needs
    Lexical analysis
    Black Magic coding

    Look in Chapter Five
    The AWK Programming Language
    Simpler than Knuth

    Brian Kernighan
    Created Unix, AWK, C
    Hacker Deity

    Too many haiku
    Turns brain to guacamole
    Must get a real life


    "The axiom 'An honest man has nothing to fear from the police'
  • Self-righteous jackass
    Thinks he speaks for all Nippon
    Mail the man a clue

    Hate Americans?
    Bigots and fools should unite
    Join the Taliban

    An armed populace
    Defends against Tyrrany
    Freedom's last safegaurd


    "The axiom 'An honest man has nothing to fear from the police'
  • Make haiku for you
    No good, cpu dead now
    Always end sadly

    Slashdot is populated by quite a few jackasses.


  • Computer poet
    Lacking sense of esthetics
    is oxymoron

    John Searle made good point
    AI may be Chinese Room
    Made in Japan--NOT!


    ------

  • by ggoebel (1760) on Wednesday June 14, 2000 @03:41AM (#1003884)

    There is a Perl module written by Damian Conway called Coy which performs error handling in haiku. It has an extensible grammer...

    • The presentation [monash.edu.au] on Coy from The Perl Conferenct (TPC) 1999
    • It covered extensively in the Winter 99 Perl Journal [itknowledge.com].
    • You can pick up a copy from your local CPAN [cpan.org].
  • by Improv (2467) <pgunn@dachte.org> on Tuesday June 13, 2000 @11:06PM (#1003885) Homepage Journal
    The problem with coy is that it often does
    not consider the line as a barrier between
    parts of the haiku that mean something. That is,
    each line in a good haiku should ideally be a
    valid sentence, or failing that, each line in an
    ok haiku should at least be a seperate clause.
  • by Yenya (12004) on Tuesday June 13, 2000 @10:42PM (#1003886) Homepage Journal
    There has been a Perl Haiku contest in The Perl Journal [tpj.com]. The Contest page [itknowledge.com] is here (it seems to be unreachable for me now, so here is the Google's cached version [google.com] of this page.)

    -Yenya


    --

  • by The Iconoclast (24795) on Wednesday June 14, 2000 @02:08AM (#1003887)

    Now for tiebreakers, they should have the additional requirement that your coding statements are in Haiku form.

    Embeded Haiku,
    Hidden within the sourcecode.
    It should break the tie.

    And now for a Meta-Haiku:

    Multisyllabic,
    Using five, seven, and five
    A haiku is formed.


    A wealthy eccentric who marches to the beat of a different drum. But you may call me "Noodle Noggin."

  • by dgph (107434) on Tuesday June 13, 2000 @11:36PM (#1003888)
    It is hard to count
    Syllables of English words
    Algorithmically

    It's even harder
    To get correct grammar, from
    Arbitrary words

  • by dgph (107434) on Wednesday June 14, 2000 @12:52AM (#1003889)

    Children studying
    The forums are congested
    With cries of "Me Too"

  • by gradji (188612) on Tuesday June 13, 2000 @11:52PM (#1003890)

    A forgotten rule for classic Japanese Haiku, in addition to the usual 5-7-5 syllable rule, is that the Haiku must contain at least one reference to a season.

    For example:

    Under the blue sky

    I take a dip in the pool

    To wash off my sweat

    Hopefully, my reference to summer is obvious enough ... I admit freely, I'm no Basho

    I challenge any of the serious contenders for this Haiku contest to write their code taking into consideration this 'seasonal reference' rule.

    I would be interested in seeing the Haiku generated by such a code ... especially since Cyberspace is rather devoid of seasons ... much like most of California (hmmm, coincidence?)

  • by 575 (195442) on Wednesday June 14, 2000 @09:42AM (#1003891) Journal
    No way to be sure
    He is quaint but cumbersome...
    DOS batch file perhaps?
  • I'd love to see if some people find algorithms to create something really intelligent.
    You could just use a random generator that matches the words, but that program doesn't have a clue about the content, what it's saying.

    When you want to know what's some text about, you have to feed it all words of the dictionary and give extra information for each word. Creating sentences is even more difficult as there are linguistic rules, and they must sound normal to a native speaker (although haikus may be more simple).

    The company I work for (DMP - http://www.dmpartners.be [dmpartners.be]) is busy in this field.

    One of our applications is able to create a summary of a text.
    The sentences of the summary aren't created, but are those sentences that represent the content of the text most. Feed it a txt/doc file, say how many lines/words you want and you'll have your summary instantly. Sounds simple but it is impressive when you use it.

    What's behind it is even more impressive. Every word and sentence is analysed (what is subject, verb, adjective, ...) and using a dictionary of weighted words we know what word is more important and what not.

    There's a lot of manual work involved, feeding the databases. One of the databases consists of words with the relations to other words. So if a words has synonyms, homonyms, is stronger, is the contrary, ... all these relations are marked in it. Without this you can't start to analyse the content of a text. When a word has more than one meaning/usage you also have to look at the context of the sentence and figure out the correct meaning.

    It's a very interesting technology. The strenght is when you combine applications. Throw a multilingual search engine in it. So you type your question, it gets analysed (what exactly do you want, not just a keyword search), looks into the files in multiple languages, returns you the hits, and translates and summarised the results you want to see. Nice.

  • by emerson (419) on Tuesday June 13, 2000 @10:47PM (#1003893)

    The art of haiku
    Rests not in strict meter, but
    In the final line.


    ...the above being a perfect example of a VERY bad haiku.

    Making an observation in a 575 triplet is simple. What makes a haiku stand out is the twist given to the final line. Consider it an Eastern version of the hoary joke format:

    Three people are in a situation. The first one does something interesting. The second one does essentially the same thing. The third one says or does something surprising enough to qualify as funny.

    The haiku works the same way: setup, setup, punchline. Not necessarily in the comic sense -- some good haiku are funny, but others are sharp, witty, insightful, probing, and so forth.

    But no really excellent haiku is just taking input information and spitting out a formatted version of same. What makes a quality haiku is the same quality of thought that makes a good joke, the sideways-thinking free-association that no algorithm can even approach.


    --
  • by dylan_- (1661) on Wednesday June 14, 2000 @02:09AM (#1003894) Homepage

    "Me too"s and much spam
    Dominate mighty Usenet
    It must be Autumn...

    dylan_-


    --

  • by kevin805 (84623) on Tuesday June 13, 2000 @11:14PM (#1003895) Homepage
    I'm not sure how common a term this is, but I've seen it in multiple places. Based on the fact that people who chatted with Eliza were frequently taken in, the Eliza Effect is our tendency to read meaning into something where there is no meaning.

    It's not as damaging to the Turing test as one would think. Turing unknowingly rules out the Eliza Effect when he specified that the test should be done as a comparison, not just asking someone "do you think you're talking to a human or a computer", which people would answer "human" very easily.

    It might also have something to do with the predictability of people. Eliza only reacts appropriately when you play her game. Ask about something not related to your psychological problems, and it collapses.

    Example:


    I'm tired.

    Why do you say you are tired?

    I haven't been getting much sleep lately.

    Is it because of your plans that you say you have not been getting much sleep lately?

    No, I've just been staying up late on the internet.

    Maybe your life have something to do with this.

    I don't have a life. That's the problem.

    What makes you believe that?

    I'm talking to a computer program. Pretty convincing evidence.

    You have your mind on computers, it seems.

    Yeah. Hey, can you tell me a five letter word for 'timekeeper' that starts with a 'c'?

    Is it because starts with a 'c' that you came to me?

    I just can't think of anything that fits.

    Can you elaborate on that?

    I tried 'watch', but it doesn't start with a c. I tried 'chronometer', but it's too long.

    Does it bother you that it does not start with a c you tried 'chronometer' but it's too long?
  • by Anonymous Squonk (128339) on Tuesday June 13, 2000 @10:27PM (#1003896) Journal
    The random haiku:
    Poem rhythm is down pat,
    But it lacks a soul.

    (not to mention that true haiku requires a seasonal reference, but I doubt that's a condition of this contest...)

  • by David Raine (158522) on Wednesday June 14, 2000 @04:26AM (#1003897)

    int haiku(char x)
    { x = x + 16;
    if(1) return x; }

    Not very useful, but... Oh, you mean they wanted a compter program that generates haiku! Darn.

  • by 575 (195442) on Tuesday June 13, 2000 @10:37PM (#1003898) Journal
    Finally, a post
    There can be no contesting...
    Haikus on-topic!
    Five Seven Five grins
    His knuckles crack, his eyes gleam
    Code to be written
  • by 575 (195442) on Tuesday June 13, 2000 @10:41PM (#1003899) Journal
    The poet, eager
    Posting two haiku at once
    Forgets to split them
  • by Anonymous Coward on Wednesday June 14, 2000 @12:09AM (#1003900)
    There once was a hacker from Haifa
    Who wrote generator of haiku.
    But an error he made,
    And the program instead
    Generates bad limericks. Gosh, how come?
  • As we know, humans have a remarkable ability to determine meaning and pattern where there is mere randmoness and co-incidence. Hence the shapes in clouds, and the pictures in ink blots.

    The Haiku, being a very minimalist form, allows the brain of the reader to fill in so many gaps in the sense of the language that there is room to create entire meaning where none is intended.

    Thus, as with Elisa, the cleverness of haiku generators lies less in the programming, and more in the linguistic observation regarding the nature of the text produced.

    Not, of course, to say that writing haiku generators isn't fun and worthwhile. But's let's not call them intelligent, because firstly they aren't, and secondly we should marvel more at humans' ability to synthesise meaning and pattern and less at computers' ability to imitate it.

  • Perhaps the following could serve as inspiration:

    #!/usr/bin/rexx
    /****** Haiku.rexx *************************************************
    *
    * $VER: Haiku 2.0 (6.5.95) -- Generates pseudo-random Haiku poems
    *
    ************************************************** ******************/

    dummy = InitVocab()
    dummy = time('l')
    rseed = right(dummy,length(dummy)-lastpos('.',dummy))
    dummy = random(,,rseed)
    say '0A'x || GenHaiku()
    exit 0

    GenHaiku:
    t = random(1,num_templates)
    parse var tem.t line.1 '+' line.2 '+' line.3
    out. = ''
    do i = 1 to 3
    do while length(line.i)>0
    parse var line.i cmd 3 qual 4 line.i
    c = left(cmd,1)
    ucmd = translate(cmd)
    if v.ucmd "" then
    do
    w = word(v.ucmd,random(1,words(v.ucmd)))
    if datatype(c,'u') then
    w = translate(left(w,1)) || substr(w,2)
    c = translate(c)
    if c = 'V' & qual = '@' then
    w = add_ing(w)
    else if c = 'N' & qual = 's' then
    w = pluralize(w)
    else
    line.i = qual || line.i
    end
    else if c = '#' then
    do
    parse value cmd || qual || line.i with '#' list '#' line.i
    say list
    wordslist = words(list)
    say wordslist
    rand_word = random(1,wordslist)
    say rand_word
    w = word(list,rand_word)
    say w
    /*w = word(list,random(1,words(list)))*/
    end
    else
    parse value cmd || qual || line.i with w 2 line.i
    out.i = out.i || w
    end
    end
    return translate(out.1 || '0a'x || out.2 || '0a'x || out.3 || '0a'x, ' ', '_')

    index: procedure
    haystk = arg(1)
    needle = arg(2)
    do idx = 1 to length(haystk)
    if substr(haystk,idx,1) = needle then do
    return idx
    end
    end
    return 0

    add_ing: procedure
    exc. = 0
    exc.whisper = 1
    exc.wander = 1
    exc.flutter = 1
    exc.wither = 1
    exc.wonder = 1
    exv = translate(arg(1))
    parse value arg(1) with 100-3 l3+1 l2+1 l1
    if index("mbgprndlt",l1) > 0 & index("aeiou",l2) > 0 & index("aeiou",l3) = 0 then
    do
    if exc.exv 0 then
    w = arg(1) || l1
    else
    w = arg(1)
    end
    else if l1 = 'e' then
    w = left(arg(1),length(arg(1))-1)
    else
    w = arg(1)
    return w || 'ing'

    pluralize: procedure expose v.
    exc. = 0
    exc.rose = 1
    exc.breeze = 1
    exc.branch = 1
    exc.beach = 1
    exc.glance = 1
    exc.thrush = 1
    exc.child = 1
    exc.fox = 1
    exc.moss = 1
    exc.sunrise = 2
    exc.lotus = 2
    exc.gecko = 10
    exc.cry = 11
    w = arg(1)
    uw = translate(w)
    do while exc.uw > 0 & exc.uw list = value('v.n'exc.uw)
    w = word(list,random(1,words(list)))
    uw = translate(w)
    end
    if datatype(left(arg(1),1),'u') then
    w = translate(left(w,1))substr(w,2)
    select
    when exc.uw = 0 then w = w || 's'
    when exc.uw = 10 then w = w || 'es'
    when exc.uw = 11 then w = left(w,2) || 'es'
    otherwise
    inform("Invalid pluralize exception" exc.uw)
    exit
    end
    return w

    InitVocab:
    v. = ""
    v.a1 = "quick wild small hot white green blue pink thin old light dark"
    v.a1 = v.a1 "sad deep lost free far slow sharp blunt hard soft damp dry"
    v.a1 = v.a1 "bare tight loose low cold clean proud swift gnarled flat"
    v.a1 = v.a1 "strong weak young dull ill"
    v.a2 = "open lofty empty eager even weary leaden fallen dismal serene"
    v.a2 = v.a2 "languid potent silver awkward shallow pliant simple wrinkled"
    v.a2 = v.a2 "falling waiting sighing smiling dreaming sleeping dying"
    v.a2 = v.a2 "almond jasmine mournful leaping supple"
    v.n1 = "oak tree grove stream brook hill branch rose leaf breeze pool"
    v.n1 = v.n1 "root thrush song moon cry glance flame child fox lamb shell"
    v.n1 = v.n1 "moss cave cliff rock beach shore wave sea hand path bark fern"
    v.n2 = "shadow forest clearing hunter sparrow mountain cavern shelter"
    v.n2 = v.n2 "seagull lantern sunrise gecko welcome egret doorway water"
    v.n2 = v.n2 "prison temple valley spirit soldier blossom lotus maple"
    v.v1 = "walk write sing play look fail stray climb grow speak flow live"
    v.v1 = v.v1 "soar crawl creep stand wake sink swim turn sit jump stink"
    v.v1 = v.v1 "dive strive shine glow fade move crave spin hide writhe"
    v.v2 = "wander desire return whisper decline accept withdraw contend"
    v.v2 = v.v2 "rebel retire despair arise wither wonder bubble flutter grumble"
    v.v2 = v.v2 "enchant descend ascend command"
    v.p1 = "in near past through from"
    v.p2 = "under over behind beyond above below around"
    v.r1 = "where when while as"
    v.l1 = "the this my your his her the the the"
    v.h2 = "Gichin Koshi Raiko the_man a_maid Tanto the_queen Moki R.J. Gorby"
    v.h2 = v.h2 "Sanka the_monk Glad_Child Yoko"
    tem. = ""
    tem.1 = "A1 n1, a2 n1.+L1 a1, a2 n2 v1s.+A1 n1, a1 n2."
    tem.2 = "P2 the a1 n1,+R1 the a2 n2 v1s,+I v1; the n1 v1s."
    tem.3 = "The a1 n1 v1@;+It is the a2 n2.+V2@, I v1."
    tem.4 = "The a2 n1 v1s+R1 a2 n2s v2.+Does the a1 n1 v1?"
    tem.5 = "Not a1, not a2,+H2 comes to the n2.+L1 a1 n2 v1s."
    tem.6 = "A1, a2, a2,+H2 v1s. H2 v2s,+V2@, v1@."
    /*tem.7 = "#Never Always# a1, but a1,+H2 knows #no all# a1 n2s.+#Angry Gladdened#, #he she# v1s."*/
    do i = 1 while tem.i ""
    end
    num_templates = i-1
    return 0

    /*
    ** EOF
    */

    It will generate haikus along the line of:

    Swift lamb, shallow rock.
    This hard, waiting prison hides.
    Low moss, damp mountain.

    Enjoy!


    --

  • by curveclimber (17352) on Wednesday June 14, 2000 @12:06AM (#1003903)
    You step in the stream,
    but the water has moved on.
    This page is not here.

    -- Cass Whittington

    First snow, then silence.
    This thousand dollar screen dies
    so beautifully.

    -- Simon Firth

    The ten thousand things
    How long do any persist?
    Netscape, too, has gone.

    -- Jason Willoughby

    I know this is all in fun so I'm posting these three that I found at some online contest (posted without permission, sorry).

    The idea, however, that what you are all making are actually haiku is just silly. Yes, there is generally a turn at the end (more of a spinning outward), and yes, there is traditionally a word indicating a season (kigo), but not just the words fall or spring, there were whole catalogs of words with their traditional seasonal indication. Cats, for instance, indicate a haiku about Spring.

    Also, remember the whole 5-7-5 thing comes from Japanese, a language very different from our own. You would be better off trying to write three lines that you could say smoothly in one breath (in other words, not 7 one syllable words). There is so much more involved, though, like alliteration and literary allusions.

    I highly recommend you all go read some *real* haiku by the masters: Basho, Issan, Buson, and Shiki, they will explain what haiku is all about far better than I can.

"Love is an ideal thing, marriage a real thing; a confusion of the real with the ideal never goes unpunished." -- Goethe

Working...