# Generate an understandable sentence

Problem:

Generate a sentence that can be read and understood. It must contain a subject, verb, and object, and tenses and plurals must match. The program must also be able to generate several different sentences to qualify.

Rules:

• Hard-coding the sentences is not permitted, and nor is reading them directly from a file (i'm looking at you, unclemeat)
• You can have any number of word lists
• Submit an example sentence or 2 that have been generated by your program
• Any language is accepted
• It's a , so the most upvoted answer wins
• I think it's clear from some of the answers (MatLab I'm looking at you) that you should modify the rules such that data-mining is not allowed to pull consecutive words from any source. – Carl Witthoft Feb 21 '14 at 13:50
• While I'm being a smartass: since it's purely a popularity contest, someone should just post a HotModelBikini jpg. That'll get more votes than anything. – Carl Witthoft Feb 21 '14 at 15:03
• I'll upvote anyone who uses repetitions of "buffalo" or "fish" as sample sentences! – user15259 Feb 21 '14 at 16:19
• Most answers here either mine valid, full sentences from text sources, or generate output that does not meet the criteria. To me, both approaches seem against the spirit of the question! If someone really wants to impress, might I suggest a program that starts with a set of valid sentence structures like [Adjective] [pl. noun] [verb] [adjective] [pl. noun] and pulls from a real dictionary (maybe using one of the Dictionary APIs available out there) to fill in the blanks? I'd write it myself if I had a few minutes to spare! :( After all... Lazy Developers Write Lousy Programs. – Brian Lacy Feb 21 '14 at 17:21
• @Pureferret Word lists would be lists of individual words. Hard coding would be a list of complete sentences. With word lists, you would typically need some logic in the program to piece together a complete sentence. With hard coded sentences, you basically just need a print statement. – 8bittree Feb 27 '14 at 15:03