Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1017926 // ai_tryRuleWithDefaultFacts

JavaX fragment (include)

sS ai_tryRuleWithDefaultFacts(S ruleID, S input) {
  Pair<L<IfThen>, LS> p = ai_activeRulesAndFacts();
  L<IfThen> rules = filterByField(p.a, globalID := ruleID);
  if (empty(rules)) ret "Rule " + ruleID + " not found";
  new NLLogicChecker_v3 c;
  c.facts = p.b;
  c.input = input;
  new L checkingLog;
  nlLogic_collectCheckingLog(c, checkingLog);
  applyNLLogicFacts_v4(c, null, rules);
  ret lines(checkingLog);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017926
Snippet name: ai_tryRuleWithDefaultFacts
Eternal ID of this version: #1017926/1
Text MD5: 7c09ba0c1ade6db1de7b587d0655babf
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-20 19:06:15
Source code size: 428 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 318 / 340
Referenced in: [show references]