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

67
LINES

< > BotCompany Repo | #1021596 // "Pizza with..." [shortened]

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

Download Jar. Libraryless. Click here for Pure Java version (14308L/103K).

1  
!7
2  
3  
sS data = [[
4  
5  
---- Rules
6  
7  
// Some reasonings that everybody will understand.
8  
// Sorry for the curly braces, we have to help out the parser a tiny bit.
9  
// First, the 3 different cases of what "pizza with..." can mean.
10  
11  
  I ate pizza with pepperoni.
12  
  => {I ate pizza} and {the pizza had pepperoni on it}.
13  
  
14  
  I ate pizza with Bob.
15  
  => {I ate pizza} and {Bob was with me}.
16  
  
17  
  I ate pizza with a fork.
18  
  => I used a fork to eat pizza.
19  
  
20  
// Now some more easy rules.
21  
  
22  
  I used a fork to eat pizza.
23  
  => I used a fork.
24  
  
25  
  I used a fork.
26  
  => A fork is a tool.
27  
  
28  
  The pizza had pepperoni on it.
29  
  => Pepperoni is edible.
30  
  
31  
  Bob was with me.
32  
  => Bob is a person.
33  
34  
// Some VERY basic mathematical logic
35  
36  
  $A and $B.
37  
  => $A.
38  
  
39  
  $A and $B.
40  
  => $B.
41  
42  
// Tell the machine what is not plausible
43  
44  
  Mom is edible. => fail
45  
  Mom is a tool. => fail
46  
  anchovis are a tool. => fail
47  
  anchovis are a person. => fail
48  
  ducks are a tool. => fail
49  
  ducks are a person. => fail
50  
  my hands are edible. => fail
51  
  my hands are a person. => fail
52  
53  
// That's it! Now for the input.
54  
55  
---- Input
56  
57  
  I ate pizza with mom.
58  
  I ate pizza with anchovis.
59  
  I ate pizza with ducks.
60  
  I ate pizza with my hands.
61  
62  
]];
63  
64  
p-exp {
65  
  centerBigTTConsole();
66  
  new Gazelle_MiniEngine1().run(data);
67  
}

Author comment

Began life as a copy of #1021251

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021596
Snippet name: "Pizza with..." [shortened]
Eternal ID of this version: #1021596/7
Text MD5: eff82386238d9136bcecd78717ed0317
Transpilation MD5: 0073cc21bc9413b80f43f8f82967877c
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-21 20:02:08
Source code size: 1340 bytes / 67 lines
Pitched / IR pitched: No / No
Views / Downloads: 303 / 787
Version history: 6 change(s)
Referenced in: [show references]