Hacker News new | past | comments | ask | show | jobs | submit login

I used a similar but less sophisticated type of process to generate random space station announcement messages for the hackerspace, such as "Problem detected in hyperspace bay three." Mostly, making sensible messages comes down to using word lists that make sense in the context. "caterpillar" is a perfectly valid noun, but it doesn't fit on a space station: "Problem detected in beautiful caterpillar omega" just doesn't have the same ring to it.

I implement phrases at the top level, with rules like: "sentence: $foreign_object_noun detected in $spaceship_part_noun"

Articles and plurals are problems. I may have to add some actual code to deal with them, as the OP did, rather than just blind string replacement with a rules table. It's a shame that "noun: $adjective $noun" doesn't cut it. Stupid English.




Caterpillar is also a pretty well known brand of construction equipment. I could imagine the tools of the future could be named after all sorts of animals.

There could even be some funny environmental storytelling there, administrators could call things by formal names, workers who grew up on earth could call them by similar animals, workers who grew up on the space-station might have become familiar with the equipment before knowing about the animals, so their associations might be backwards.

But it all like it’d have to be done intentionally, generating these associations procedurally seems like a total mess.


Did something like this back in '96 w/ a recursive macro parser. Stuff like:

"To %TABLOID%, %CELEB% %ADVERB% %ACTION.PAS% %NUMBER% %OBJECT.P%."

Each substitution referenced a file and entries in those files could reference other files (or themselves).

Reflecting the zeitgeist, in the "CELEB" file I find: "Billy Corgan, frontman of %ADVERB% %ADJEC% band The Smashing Pumpkins"

If I was going to do it again today I'd combine tenses into a single file and have the parser track the tense that should be used based on previously selected words. That's probably a lot harder than I think it would be.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: