!7 cmodule WatchThisTrickMate > DynPrintLog { class FactCondition implements Runnable { S text; Runnable action; *() {} *(S *text, Runnable *action) {} run { } toString { ret "if {" + text + "} => " + action; } } start-thread { dm_useLocalMechListCopies(); /*L rules = map wordTokReplacerRuleOnXY(splitAtEmptyLines([[ [heard] you must watch {this trick} => [implied] {this trick} is very good [heard] you must watch {this trick} + [fact] i have watched {this trick} => [say] Thanks, I've seen it already [heard] you must watch {this trick} + [fact] i have not watched {this trick} => [say] Well... I haven't seen it yet, so maybe I should ]]));*/ new L continuations; L rules = ll( WordTokReplacer_es1( "[heard] you must watch {this trick}", "", "[implied] {this trick} is very good"), WordTokReplacer_es1( "[heard] you must watch {this trick}", "", "[say] Thanks, I've seen it already") { run { continuations.add(print(new FactCondition("i have watched {this trick}", r emitOut))); } } ); S s = "you must watch this trick"; pnl(extsToString /*uniquifyMap tok_dropCurlyBrackets*/(iterateHull(func(ExtS s) -> L { print("Processing: " + extToString(s)); ret listPlusNempties_es( applyAttractors_es(rules, ll(s)), extMap_verbose tok_dropCurlyBrackets(s), extMap_verbose ai_dropFillers1(s), extMap_verbose ai_groupTheAdjectiveNoun(s), extMap_verbose ai_groupSimplestNounPhrases2(s)); }, makeExt(s, type := "heard")))); print("Have " + n2(continuations, "continuation")); } }