S input = "Bob paid for Charlie's college education. He is very [generous/grateful]. Who is [generous/grateful]?"; S multiStage = dm_showNewModule("#1027106/MultiStageProcessing"); // Stage 1: take first option out of square brackets S input2 = winograd_takeFirstOption(input); dm_call(multiStage, 'addStage, "Take first option", input2); // Stage 1b: Split off 's S input2b = ai_splitOffApostropheS(input); dm_call(multiStage, 'addStage, "Split off 's", input2b); // Stage 2: Split into sentences LS sentences = sentences(input2b); dm_call(multiStage, 'addStage, "Split into sentences", sentences); // Stage 2b: Apply patterns to sentences S parser = dm_makeModule("#1027108/TopDownParsing"); L parsed = map(sentences, s -> dm_call(parser, 'parse, s)); dm_call(multiStage, 'addStage, "Apply patterns", parsed); // Stage 2c: Ask user questions to check validity of assumptions // Stage 3: Find strong words in input // [Stage 3: Identify actors in input (people or things)] // Stage 4: Find a useful scenario in DB // Stage 5: Map scenario to input // Stage 6: Identify and answer question //dm_showListWithFeedback(func -> LS { sentences(input) }, info := litorderedmap(+input));