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

28
LINES

< > BotCompany Repo | #1018081 // nlLogic_unresolvedFactsToQuestions

JavaX fragment (include)

1  
scope nlLogic_unresolvedFactsToQuestions.
2  
3  
sbool #debug;
4  
5  
static Collection<S> nlLogic_unresolvedFactsToQuestions(RuleFailInfo ruleFail) {
6  
  if (ruleFail == null) ret emptyList();
7  
  Exp e = nlLogic_applyMatches(nlLogic_firstCondition(ruleFail.remainingConditions), ruleFail.matches);
8  
  // Now have: fact(bla) in e
9  
  
10  
  if (e cast Func)
11  
    if (eq(e.name, 'fact)) {
12  
      S fact = "Unresolved fact: " + e.arg.text();
13  
      if (debug) print(fact);
14  
      Pair<L<IfThen>, LS> p = ai_activeRulesAndFacts(ll(fact));
15  
      ret ai_deriveOutput(p.a, p.b);
16  
    }
17  
    
18  
  ret emptyList();
19  
}
20  
21  
static Collection<S> nlLogic_unresolvedFactsToQuestions(Collection<RuleFailInfo> ruleFails) {
22  
  new LinkedHashSet<S> out;
23  
  for (RuleFailInfo fail : ruleFails)
24  
    addAll(out, nlLogic_unresolvedFactsToQuestions(fail));
25  
  ret out;
26  
}
27  
28  
end scope

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: #1018081
Snippet name: nlLogic_unresolvedFactsToQuestions
Eternal ID of this version: #1018081/5
Text MD5: 968e1fd54d5c27c1c6577472543a866b
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-29 16:21:00
Source code size: 849 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 333 / 352
Version history: 4 change(s)
Referenced in: [show references]