CSC151 2007S, Class 25: Project: Text Generation (Part One) Admin: * Reading for tomorrow: More about text generation. * Your goal for this week: Figure out text generation and then generate something interesting. * Survey: * On side 1: Your name * On side 2: List five most important lessons from PB&J (no looking online) * EC for excellent answers * Explanation of survey * Sam presents on this stuff Overview: * The Problem. * Strategies. * The project: Your goal. * Lab. /The Problem/ * Can we make computer "simulate" human thought or activities? * Simple domain: Writing. * Extended version of Madlibs. * My goal: Give you the building blocks. * Your goal: Write procedure that writes "interesting" texts * NOT Haiku * Your secondary goal: Explain how your stuff works. * IN TEAMS! (Selected in class on Wednesday.) /Basic Strategies for "Random" Text Generation/ * Issue one: Generate basic parts of speech: noun, transitive verbs, intransitive verbs, adverbs, adjectives, exclamations, ... * Transitive verbs have direct objects. * Intransitive verbs do not have objects. * Issue two: Generate compound parts of speech: noun-phases, clauses, sentences, haiku, ... How to randomly generate basic parts of speech * Create a file, where each line has the form ("STRING" INTEGER) * Sum of the integers should be 1000 ("dog" 500) ("cat" 400) ("llama" 100) * We need to randomly select from that file (generate-part-of-speech 'part-of-speech) How to build compound things * Call a procedure for each part * String-append 'em together. LAB /Wrapup: Your favorite generated sentences./ * A happy grade in comp sci defenestrated our smiley disco outfit. * A corpulent banana jumped over a lazy kangaroo.