static S ctxFindRuleForInput() { CtxContext ctx = ctxContext(); WoodyRule activeRule = woodyBot().getRule(ctx.activeRule); WoodyBot bot = woodyBot(); if (ctx.activeAnalyzer != null && ctxProcessRule(ctx.activeAnalyzer)) ret ctx.nextRule; if (activeRule != null) { print("Active rule: " + activeRule.fullName); WoodyRule analyzer = bot.getRule(activeRule.properties.get("ANALYZER")); print("Analyzer: " + getOpt(analyzer, "fullName")); if (analyzer != null) { // TODO } try answer ctxFindRuleForInput_default(); ret activeRule.fullName; } ret ctxFindRuleForInput_default(); } sS ctxFindRuleForInput_default() { new L matchingRules; for (WoodyRule rule : woodyOnRules(woodyBot())) if (rule.parsedCondition != null && rule.parsedCondition.get()) { print("Matching: " + rule.fullName); matchingRules.add(rule); } if (empty(matchingRules)) null; if (l(matchingRules) > 1) print("Warning: Have multiple matching rules, picking " + first(matchingRules).fullName + " over " + collect(+fullName, dropFirst(matchingRules))); ret first(matchingRules).fullName; }