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

40
LINES

< > BotCompany Repo | #1014772 // Snippet Title Reasoning v2 [OK, shortened]

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

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (9936L/65K).

1  
!7
2  
3  
sS inspiration = [[
4  
  snippet titles
5  
  "[OK]"
6  
]];
7  
8  
sS program = [[
9  
  // check inspiration :o)
10  
  assert(inspired "snippet titles")
11  
  assert(inspired "\"[OK]\"")
12  
13  
  // phrases
14  
  phrase "snippet titles"
15  
  phrase "a list of strings"
16  
  phrase "a quoted string"
17  
  
18  
  // synonyms
19  
  "the snippet titles" = "snippet titles"
20  
  
21  
  // grammar
22  
  singular_plural("snippet title", "snippet titles")
23  
  
24  
  // test parsing
25  
  assert_parse("snippet titles are a list of strings", "snippet titles", "are", "a list of strings")
26  
  
27  
  // facts
28  
  snippet titles are a list of strings
29  
  "[OK]" is a quoted string
30  
  
31  
  // rule to answer a question
32  
  fact_question_answer_upperCaseVars("X are Y", "what are X?", "Y")
33  
  
34  
  // check the rule
35  
  assert_answer("what are snippet titles?", "a list of strings")
36  
]];
37  
38  
p-experiment-tt {
39  
  new RuleEngine(inspiration, program).printStuff();
40  
}

Author comment

Began life as a copy of #1014753

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014772
Snippet name: Snippet Title Reasoning v2 [OK, shortened]
Eternal ID of this version: #1014772/7
Text MD5: da6cf4f694b738b9632a4cb719371be6
Transpilation MD5: 5b8957750b278545c80bc4decc628123
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-05-02 09:10:01
Source code size: 897 bytes / 40 lines
Pitched / IR pitched: No / No
Views / Downloads: 341 / 1316
Version history: 6 change(s)
Referenced in: [show references]