!7 cmodule ShoppingList > DynPrintLog { transient S input = [[ okay shopping list buy bananas at least three I have to be cheap they have to be cheap buy potatoes also get some milk newspapers hold on I have a phone call hey Mom yes mam it's all good by Mom okay I'm back where were we buy some chicken or maybe no chicken okay that's all ]]; transient S rules = [[ sentence => "(first/then/also/) we (will/) need (some/) " => buy $1 sentence => "(first/then/also/) (buy/get/you should get) (some/) " => buy $1 sentence => "they have to be " => last item has to be $1 sentence => "at least " => last item quantity at least $1 sentence => "or (maybe/rather/) no " => don't buy $1 after all ]]; LS intermediate; // intermediate result (buy X, ...) start-thread { new RecursiveProbabilisticParser1 parser; parser.splitIntoSentences = lambda1 tlft; setField(intermediate := recursiveProbabilisticParse(rules, "sentence", input, +parser)); pnlWithHeading("Intermediate result", intermediate); } }