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

18
LINES

< > BotCompany Repo | #1018220 // Facts from input [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (9451L/52K).

1  
!7
2  
3  
p-exp {
4  
  BakedBot bot = bakedBotWithRules([[
5  
    anyInput()
6  
      && $x, $y in eval(listToOverlappingPairs(words(ai_input())))
7  
      => fact($_q_x and $_q_y are words next to each other)
8  
  ]]);
9  
  setOpt(bot.factsBot(), useIterate := true);
10  
11  
  bot.imagineMode();
12  
  bot.check("hello world yo", [[
13  
    Storing imaginary fact: "hello" and "world" are words next to each other
14  
    Storing imaginary fact: "world" and "yo" are words next to each other
15  
  ]]);
16  
  
17  
  assertEqualsVerbose(2, l(get(bot.factsBot(), 'imaginedFacts)));
18  
}

Author comment

Began life as a copy of #1018149

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: #1018220
Snippet name: Facts from input [OK]
Eternal ID of this version: #1018220/11
Text MD5: 9638c019542cc29ee64fece07d276c2b
Transpilation MD5: 1c8f1c6b7cfcca48d4e43d5753bece24
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-10 16:37:02
Source code size: 545 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 360 / 750
Version history: 10 change(s)
Referenced in: [show references]