ekms 8.0.0-beta.57 → 8.0.0-beta.59

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,11 @@
1
1
  const { knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dialogues = require("./dialogues")
4
+ const concept = require("./concept")
4
5
  const numbers = require("./numbers")
5
6
  const comparable_tests = require('./comparable.test.json')
7
+ const comparable_instance = require('./comparable.instance.json')
8
+
6
9
 
7
10
  let config = {
8
11
  name: 'comparable',
@@ -11,8 +14,7 @@ let config = {
11
14
  "(([condition/1]) <compare|> ([comparable]))",
12
15
  "([highest])",
13
16
  "([lowest])",
14
- "((comparable/*) <ascending>)",
15
- "((comparable/*) <descending>)",
17
+ // "((comparable/*) <sortOrdering|>)",
16
18
  ],
17
19
  bridges: [
18
20
  {
@@ -41,8 +43,9 @@ let config = {
41
43
  id: "highest",
42
44
  bridge: "{ ...next(operator) }"
43
45
  },
46
+ /*
44
47
  {
45
- id: "ascending",
48
+ id: "sortOrdering",
46
49
  isA: ['adjective'],
47
50
  bridge: "{ ...next(before[0]), ordering: 'ascending', ascending: operator, postModifiers: append(['ascending'], before[0].postModifiers) }"
48
51
  },
@@ -51,12 +54,38 @@ let config = {
51
54
  isA: ['adjective'],
52
55
  bridge: "{ ...next(before[0]), ordering: 'descending', descending: operator, postModifiers: append(['descending'], before[0].postModifiers) }"
53
56
  },
57
+ */
54
58
  ],
55
59
  };
56
60
 
61
+ const template = {
62
+ configs: [
63
+ "sort modifies ordering",
64
+ "ascending is a sort ordering",
65
+ "descending is a sort ordering",
66
+ {
67
+ operators: [
68
+ "((comparable/*) [sortOrdering] (<sort_ordering/*))",
69
+ ],
70
+ bridges: [
71
+ {
72
+ id: 'sortOrdering',
73
+ convolution: true,
74
+ isA: ['adjective'],
75
+ bridge: "{ ...next(before[0]), ordering: after[0].value, sortOrder: after[0], postModifiers: append(['sortOrder'], before[0].postModifiers) }",
76
+ },
77
+ ],
78
+ }
79
+ ],
80
+ }
81
+
57
82
  knowledgeModule({
58
83
  config,
59
- includes: [dialogues, numbers],
84
+ includes: [dialogues, numbers, concept],
85
+ template: {
86
+ template,
87
+ instance: comparable_instance
88
+ },
60
89
 
61
90
  module,
62
91
  description: 'Comparable things',
@@ -2432,6 +2432,24 @@
2432
2432
  1
2433
2433
  ]
2434
2434
  ],
2435
+ [
2436
+ [
2437
+ "is",
2438
+ 0
2439
+ ],
2440
+ [
2441
+ "possession",
2442
+ 0
2443
+ ],
2444
+ [
2445
+ "unknown",
2446
+ 0
2447
+ ],
2448
+ [
2449
+ "unknown",
2450
+ 1
2451
+ ]
2452
+ ],
2435
2453
  [
2436
2454
  [
2437
2455
  "is",
@@ -3812,6 +3830,24 @@
3812
3830
  1
3813
3831
  ]
3814
3832
  ],
3833
+ [
3834
+ [
3835
+ "is",
3836
+ 0
3837
+ ],
3838
+ [
3839
+ "possession",
3840
+ 0
3841
+ ],
3842
+ [
3843
+ "unknown",
3844
+ 0
3845
+ ],
3846
+ [
3847
+ "unknown",
3848
+ 1
3849
+ ]
3850
+ ],
3815
3851
  [
3816
3852
  [
3817
3853
  "is",
@@ -5192,6 +5228,24 @@
5192
5228
  1
5193
5229
  ]
5194
5230
  ],
5231
+ [
5232
+ [
5233
+ "is",
5234
+ 0
5235
+ ],
5236
+ [
5237
+ "possession",
5238
+ 0
5239
+ ],
5240
+ [
5241
+ "unknown",
5242
+ 0
5243
+ ],
5244
+ [
5245
+ "unknown",
5246
+ 1
5247
+ ]
5248
+ ],
5195
5249
  [
5196
5250
  [
5197
5251
  "is",
@@ -9325,6 +9379,24 @@
9325
9379
  1
9326
9380
  ]
9327
9381
  ],
9382
+ [
9383
+ [
9384
+ "is",
9385
+ 0
9386
+ ],
9387
+ [
9388
+ "possession",
9389
+ 0
9390
+ ],
9391
+ [
9392
+ "unknown",
9393
+ 0
9394
+ ],
9395
+ [
9396
+ "unknown",
9397
+ 1
9398
+ ]
9399
+ ],
9328
9400
  [
9329
9401
  [
9330
9402
  "is",
@@ -10785,6 +10857,24 @@
10785
10857
  1
10786
10858
  ]
10787
10859
  ],
10860
+ [
10861
+ [
10862
+ "is",
10863
+ 0
10864
+ ],
10865
+ [
10866
+ "possession",
10867
+ 0
10868
+ ],
10869
+ [
10870
+ "unknown",
10871
+ 0
10872
+ ],
10873
+ [
10874
+ "unknown",
10875
+ 1
10876
+ ]
10877
+ ],
10788
10878
  [
10789
10879
  [
10790
10880
  "is",
@@ -12245,6 +12335,24 @@
12245
12335
  1
12246
12336
  ]
12247
12337
  ],
12338
+ [
12339
+ [
12340
+ "is",
12341
+ 0
12342
+ ],
12343
+ [
12344
+ "possession",
12345
+ 0
12346
+ ],
12347
+ [
12348
+ "unknown",
12349
+ 0
12350
+ ],
12351
+ [
12352
+ "unknown",
12353
+ 1
12354
+ ]
12355
+ ],
12248
12356
  [
12249
12357
  [
12250
12358
  "is",
@@ -18174,6 +18282,24 @@
18174
18282
  1
18175
18283
  ]
18176
18284
  ],
18285
+ [
18286
+ [
18287
+ "is",
18288
+ 0
18289
+ ],
18290
+ [
18291
+ "possession",
18292
+ 0
18293
+ ],
18294
+ [
18295
+ "unknown",
18296
+ 0
18297
+ ],
18298
+ [
18299
+ "unknown",
18300
+ 1
18301
+ ]
18302
+ ],
18177
18303
  [
18178
18304
  [
18179
18305
  "is",
@@ -19714,6 +19840,24 @@
19714
19840
  1
19715
19841
  ]
19716
19842
  ],
19843
+ [
19844
+ [
19845
+ "is",
19846
+ 0
19847
+ ],
19848
+ [
19849
+ "possession",
19850
+ 0
19851
+ ],
19852
+ [
19853
+ "unknown",
19854
+ 0
19855
+ ],
19856
+ [
19857
+ "unknown",
19858
+ 1
19859
+ ]
19860
+ ],
19717
19861
  [
19718
19862
  [
19719
19863
  "is",
@@ -24389,24 +24533,6 @@
24389
24533
  1
24390
24534
  ]
24391
24535
  ],
24392
- [
24393
- [
24394
- "is",
24395
- 0
24396
- ],
24397
- [
24398
- "propertyOf",
24399
- 0
24400
- ],
24401
- [
24402
- "the",
24403
- 0
24404
- ],
24405
- [
24406
- "unknown",
24407
- 1
24408
- ]
24409
- ],
24410
24536
  [
24411
24537
  [
24412
24538
  "is",
@@ -27763,24 +27889,6 @@
27763
27889
  1
27764
27890
  ]
27765
27891
  ],
27766
- [
27767
- [
27768
- "is",
27769
- 0
27770
- ],
27771
- [
27772
- "propertyOf",
27773
- 0
27774
- ],
27775
- [
27776
- "the",
27777
- 0
27778
- ],
27779
- [
27780
- "unknown",
27781
- 1
27782
- ]
27783
- ],
27784
27892
  [
27785
27893
  [
27786
27894
  "is",
@@ -37893,32 +38001,6 @@
37893
38001
  1
37894
38002
  ]
37895
38003
  ],
37896
- [
37897
- [
37898
- "arm",
37899
- 0
37900
- ],
37901
- [
37902
- "is",
37903
- 0
37904
- ],
37905
- [
37906
- "means",
37907
- 0
37908
- ],
37909
- [
37910
- "propertyOf",
37911
- 0
37912
- ],
37913
- [
37914
- "the",
37915
- 0
37916
- ],
37917
- [
37918
- "unknown",
37919
- 1
37920
- ]
37921
- ],
37922
38004
  [
37923
38005
  [
37924
38006
  "arm",
@@ -40204,36 +40286,6 @@
40204
40286
  1
40205
40287
  ]
40206
40288
  ],
40207
- [
40208
- [
40209
- "disarm",
40210
- 0
40211
- ],
40212
- [
40213
- "is",
40214
- 0
40215
- ],
40216
- [
40217
- "means",
40218
- 0
40219
- ],
40220
- [
40221
- "not",
40222
- 0
40223
- ],
40224
- [
40225
- "propertyOf",
40226
- 0
40227
- ],
40228
- [
40229
- "the",
40230
- 0
40231
- ],
40232
- [
40233
- "unknown",
40234
- 1
40235
- ]
40236
- ],
40237
40289
  [
40238
40290
  [
40239
40291
  "disarm",
@@ -40727,32 +40779,6 @@
40727
40779
  1
40728
40780
  ]
40729
40781
  ],
40730
- [
40731
- [
40732
- "arm",
40733
- 0
40734
- ],
40735
- [
40736
- "is",
40737
- 0
40738
- ],
40739
- [
40740
- "means",
40741
- 0
40742
- ],
40743
- [
40744
- "propertyOf",
40745
- 0
40746
- ],
40747
- [
40748
- "the",
40749
- 0
40750
- ],
40751
- [
40752
- "unknown",
40753
- 1
40754
- ]
40755
- ],
40756
40782
  [
40757
40783
  [
40758
40784
  "arm",
@@ -40869,36 +40895,6 @@
40869
40895
  1
40870
40896
  ]
40871
40897
  ],
40872
- [
40873
- [
40874
- "disarm",
40875
- 0
40876
- ],
40877
- [
40878
- "is",
40879
- 0
40880
- ],
40881
- [
40882
- "means",
40883
- 0
40884
- ],
40885
- [
40886
- "not",
40887
- 0
40888
- ],
40889
- [
40890
- "propertyOf",
40891
- 0
40892
- ],
40893
- [
40894
- "the",
40895
- 0
40896
- ],
40897
- [
40898
- "unknown",
40899
- 1
40900
- ]
40901
- ],
40902
40898
  [
40903
40899
  [
40904
40900
  "disarm",
@@ -41480,6 +41476,10 @@
41480
41476
  "possession",
41481
41477
  0
41482
41478
  ],
41479
+ [
41480
+ "unknown",
41481
+ 0
41482
+ ],
41483
41483
  [
41484
41484
  "unknown",
41485
41485
  1
@@ -41494,6 +41494,10 @@
41494
41494
  "possession",
41495
41495
  0
41496
41496
  ],
41497
+ [
41498
+ "unknown",
41499
+ 0
41500
+ ],
41497
41501
  [
41498
41502
  "unknown",
41499
41503
  1
@@ -41508,6 +41512,10 @@
41508
41512
  "possession",
41509
41513
  0
41510
41514
  ],
41515
+ [
41516
+ "unknown",
41517
+ 0
41518
+ ],
41511
41519
  [
41512
41520
  "unknown",
41513
41521
  1
@@ -41522,6 +41530,10 @@
41522
41530
  "possession",
41523
41531
  0
41524
41532
  ],
41533
+ [
41534
+ "unknown",
41535
+ 0
41536
+ ],
41525
41537
  [
41526
41538
  "unknown",
41527
41539
  1
@@ -41536,6 +41548,10 @@
41536
41548
  "possession",
41537
41549
  0
41538
41550
  ],
41551
+ [
41552
+ "unknown",
41553
+ 0
41554
+ ],
41539
41555
  [
41540
41556
  "unknown",
41541
41557
  1
@@ -41550,6 +41566,10 @@
41550
41566
  "possession",
41551
41567
  0
41552
41568
  ],
41569
+ [
41570
+ "unknown",
41571
+ 0
41572
+ ],
41553
41573
  [
41554
41574
  "unknown",
41555
41575
  1
@@ -41564,6 +41584,10 @@
41564
41584
  "possession",
41565
41585
  0
41566
41586
  ],
41587
+ [
41588
+ "unknown",
41589
+ 0
41590
+ ],
41567
41591
  [
41568
41592
  "unknown",
41569
41593
  1
@@ -41578,6 +41602,10 @@
41578
41602
  "possession",
41579
41603
  0
41580
41604
  ],
41605
+ [
41606
+ "unknown",
41607
+ 0
41608
+ ],
41581
41609
  [
41582
41610
  "unknown",
41583
41611
  1
@@ -41604,7 +41632,7 @@
41604
41632
  ],
41605
41633
  [
41606
41634
  "possession",
41607
- 1
41635
+ 0
41608
41636
  ],
41609
41637
  [
41610
41638
  "unknown",
@@ -41618,7 +41646,7 @@
41618
41646
  ],
41619
41647
  [
41620
41648
  "possession",
41621
- 1
41649
+ 0
41622
41650
  ],
41623
41651
  [
41624
41652
  "unknown",
@@ -41632,7 +41660,21 @@
41632
41660
  ],
41633
41661
  [
41634
41662
  "possession",
41663
+ 0
41664
+ ],
41665
+ [
41666
+ "unknown",
41635
41667
  1
41668
+ ]
41669
+ ],
41670
+ [
41671
+ [
41672
+ "is",
41673
+ 0
41674
+ ],
41675
+ [
41676
+ "possession",
41677
+ 0
41636
41678
  ],
41637
41679
  [
41638
41680
  "unknown",
@@ -41646,7 +41688,21 @@
41646
41688
  ],
41647
41689
  [
41648
41690
  "possession",
41691
+ 0
41692
+ ],
41693
+ [
41694
+ "unknown",
41649
41695
  1
41696
+ ]
41697
+ ],
41698
+ [
41699
+ [
41700
+ "is",
41701
+ 0
41702
+ ],
41703
+ [
41704
+ "possession",
41705
+ 0
41650
41706
  ],
41651
41707
  [
41652
41708
  "unknown",
@@ -41660,7 +41716,21 @@
41660
41716
  ],
41661
41717
  [
41662
41718
  "possession",
41719
+ 0
41720
+ ],
41721
+ [
41722
+ "unknown",
41663
41723
  1
41724
+ ]
41725
+ ],
41726
+ [
41727
+ [
41728
+ "is",
41729
+ 0
41730
+ ],
41731
+ [
41732
+ "possession",
41733
+ 0
41664
41734
  ],
41665
41735
  [
41666
41736
  "unknown",
@@ -41729,16 +41799,26 @@
41729
41799
  0
41730
41800
  ],
41731
41801
  [
41732
- "propertyOf",
41733
- 0
41802
+ "possession",
41803
+ 1
41734
41804
  ],
41735
41805
  [
41736
- "the",
41806
+ "unknown",
41807
+ 1
41808
+ ]
41809
+ ],
41810
+ [
41811
+ [
41812
+ "is",
41737
41813
  0
41738
41814
  ],
41815
+ [
41816
+ "possession",
41817
+ 1
41818
+ ],
41739
41819
  [
41740
41820
  "unknown",
41741
- 0
41821
+ 1
41742
41822
  ]
41743
41823
  ],
41744
41824
  [
@@ -41747,17 +41827,37 @@
41747
41827
  0
41748
41828
  ],
41749
41829
  [
41750
- "propertyOf",
41751
- 0
41830
+ "possession",
41831
+ 1
41752
41832
  ],
41753
41833
  [
41754
- "the",
41834
+ "unknown",
41835
+ 1
41836
+ ]
41837
+ ],
41838
+ [
41839
+ [
41840
+ "is",
41755
41841
  0
41756
41842
  ],
41843
+ [
41844
+ "possession",
41845
+ 1
41846
+ ],
41757
41847
  [
41758
41848
  "unknown",
41849
+ 1
41850
+ ]
41851
+ ],
41852
+ [
41853
+ [
41854
+ "is",
41759
41855
  0
41760
41856
  ],
41857
+ [
41858
+ "possession",
41859
+ 1
41860
+ ],
41761
41861
  [
41762
41862
  "unknown",
41763
41863
  1
@@ -41778,7 +41878,7 @@
41778
41878
  ],
41779
41879
  [
41780
41880
  "unknown",
41781
- 1
41881
+ 0
41782
41882
  ]
41783
41883
  ],
41784
41884
  [
@@ -41794,6 +41894,10 @@
41794
41894
  "the",
41795
41895
  0
41796
41896
  ],
41897
+ [
41898
+ "unknown",
41899
+ 0
41900
+ ],
41797
41901
  [
41798
41902
  "unknown",
41799
41903
  1