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

20
LINES

< > BotCompany Repo | #1017901 // ai_activeRules - preprocesses them too

JavaX fragment (include)

1  
static L<IfThen> ai_activeRules() { 
2  
 time "ai_activeRules" {
3  
  LS unparsedRules = ai_unparsedTalkRules();
4  
  
5  
  for (S listName : mL("Rule & Fact Lists"))
6  
    for (S x : splitAtEmptyLines(mL_raw(listName)))
7  
      if (anyJavaTokens(x))
8  
        if (nlLogic_parseRule(x) != null)
9  
          unparsedRules.add(x);
10  
11  
  unparsedRules = sortedByCalculatedField(unparsedRules, func(S s) { jcontains(s, "entity(") });
12  
  L<IfThen> rules = map_pcall nlLogic_parseRule(unparsedRules);
13  
  
14  
  for (S listName : mL("Default active scripts"))
15  
    addAll(rules, nlLogic_loadMechScript(listName));
16  
  
17  
  nlLogic_expandMacros(rules);
18  
 }
19  
 ret rules;
20  
}

Author comment

Began life as a copy of #1017899

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: #1017901
Snippet name: ai_activeRules - preprocesses them too
Eternal ID of this version: #1017901/5
Text MD5: 99597634abb26e242350cc6766066a2e
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 15:35:46
Source code size: 646 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 443 / 467
Version history: 4 change(s)
Referenced in: [show references]