tpmkms_4wp 8.0.0-beta.6 → 8.0.0-beta.60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/common/animals.instance.json +2871 -1379
  2. package/common/animals.js +17 -20
  3. package/common/articles.js +103 -0
  4. package/common/articles.test.json +310 -0
  5. package/common/avatar.js +5 -9
  6. package/common/characters.js +22 -28
  7. package/common/colors.instance.json +7170 -3657
  8. package/common/colors.js +4 -8
  9. package/common/colors.test.json +345 -780
  10. package/common/comparable.instance.json +1738 -0
  11. package/common/comparable.js +46 -27
  12. package/common/comparable.test.json +438 -2
  13. package/common/concept.js +120 -118
  14. package/common/countable.js +19 -13
  15. package/common/countable.test.json +1050 -0
  16. package/common/crew.instance.json +13066 -6598
  17. package/common/crew.js +36 -41
  18. package/common/crew.test.json +714 -452
  19. package/common/currency.js +27 -45
  20. package/common/dialogues.js +161 -285
  21. package/common/dimension.instance.json +474 -253
  22. package/common/dimension.js +16 -22
  23. package/common/dimension.test.json +446 -1640
  24. package/common/edible.instance.json +20059 -10007
  25. package/common/edible.js +3 -8
  26. package/common/emotions.instance.json +147 -129
  27. package/common/emotions.js +35 -38
  28. package/common/evaluate.instance.json +2 -0
  29. package/common/evaluate.js +49 -0
  30. package/common/evaluate.test.json +574 -0
  31. package/common/events.js +10 -14
  32. package/common/fastfood.instance.json +221967 -111264
  33. package/common/fastfood.js +74 -84
  34. package/common/fastfood.test.json +268 -90
  35. package/common/formulas.instance.json +455 -249
  36. package/common/formulas.js +19 -26
  37. package/common/gdefaults.js +24 -26
  38. package/common/help.js +7 -12
  39. package/common/help.test.json +22 -22
  40. package/common/helpers/concept.js +10 -7
  41. package/common/helpers/dialogues.js +2 -3
  42. package/common/helpers/properties.js +54 -62
  43. package/common/helpers.js +6 -5
  44. package/common/hierarchy.js +16 -24
  45. package/common/javascript.js +11 -18
  46. package/common/kirk.instance.json +584 -290
  47. package/common/kirk.js +5 -8
  48. package/common/length.instance.json +8834 -4757
  49. package/common/length.js +4 -8
  50. package/common/listener.js +48 -0
  51. package/common/listener.test.json +104 -0
  52. package/common/math.instance.json +425 -1187
  53. package/common/math.js +16 -20
  54. package/common/meta.js +23 -47
  55. package/common/nameable.instance.json +2 -0
  56. package/common/nameable.js +135 -0
  57. package/common/nameable.test.json +2121 -0
  58. package/common/negation.instance.json +2 -0
  59. package/common/negation.js +38 -0
  60. package/common/negation.test.json +308 -0
  61. package/common/numbers.js +27 -31
  62. package/common/ordering.instance.json +366 -246
  63. package/common/ordering.js +80 -86
  64. package/common/people.instance.json +2134 -1022
  65. package/common/people.js +8 -13
  66. package/common/percentages.instance.json +2 -0
  67. package/common/percentages.js +53 -0
  68. package/common/percentages.test.json +751 -0
  69. package/common/pipboy.instance.json +11777 -6289
  70. package/common/pipboy.js +48 -59
  71. package/common/pokemon.instance.json +4226 -2081
  72. package/common/pokemon.js +7 -20
  73. package/common/pos.js +12 -13
  74. package/common/pressure.instance.json +2208 -1175
  75. package/common/pressure.js +4 -8
  76. package/common/properties.instance.json +131 -61
  77. package/common/properties.js +57 -134
  78. package/common/punctuation.js +6 -6
  79. package/common/reports.instance.json +1018 -530
  80. package/common/reports.js +73 -97
  81. package/common/scorekeeper.js +18 -30
  82. package/common/sdefaults.js +16 -7
  83. package/common/sizeable.js +6 -10
  84. package/common/spock.instance.json +584 -290
  85. package/common/spock.js +5 -8
  86. package/common/stgame.js +19 -19
  87. package/common/stm.js +164 -27
  88. package/common/stm.test.json +1734 -1
  89. package/common/tell.js +14 -18
  90. package/common/temperature.instance.json +2271 -1222
  91. package/common/temperature.js +4 -8
  92. package/common/tester.js +3 -3
  93. package/common/testing.js +8 -12
  94. package/common/time.js +20 -25
  95. package/common/tokenize.js +4 -5
  96. package/common/ui.instance.json +459 -240
  97. package/common/ui.js +16 -22
  98. package/common/weight.instance.json +7646 -4026
  99. package/common/weight.js +4 -8
  100. package/common/yesno.js +5 -5
  101. package/main.js +59 -46
  102. package/package.json +28 -5
@@ -1,23 +1,26 @@
1
- const { Config, knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
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')
6
8
 
7
- let configStruct = {
9
+
10
+ let config = {
8
11
  name: 'comparable',
9
12
  operators: [
10
13
  "([condition|])",
11
14
  "(([condition/1]) <compare|> ([comparable]))",
12
15
  "([highest])",
13
16
  "([lowest])",
17
+ // "((comparable/*) <sortOrdering|>)",
14
18
  ],
15
19
  bridges: [
16
20
  {
17
21
  id: "compare",
18
- level: 0,
19
22
  convolution: true,
20
- before: ['verby', 'articlePOS'],
23
+ before: ['verb', 'articlePOS'],
21
24
  // bridge: "{ ...after, comparison: append(before[0], after[0].comparison), modifiers: append([before[0].marker], after[0].modifiers), [before[0].marker]: before[0] }"
22
25
  // bridge: "{ ...after, comparison: append([], before[0].marker, after[0].comparison) }"
23
26
  bridge: "{ ...next(before[0]), property: after, postModifiers: append([after[0].marker], before[0].modifiers), [after[0].marker.id]: after[0] }"
@@ -26,55 +29,71 @@ let configStruct = {
26
29
  {
27
30
  id: "condition",
28
31
  children: ['highest', 'lowest'],
29
- level: 0,
30
32
  bridge: "{ ...next(operator) }"
31
33
  },
32
34
  {
33
35
  id: "comparable",
34
- level: 0,
35
36
  bridge: "{ ...next(operator) }"
36
37
  },
37
38
  {
38
39
  id: "lowest",
39
- level: 0,
40
40
  bridge: "{ ...next(operator) }"
41
41
  },
42
42
  {
43
43
  id: "highest",
44
- level: 0,
45
44
  bridge: "{ ...next(operator) }"
46
45
  },
47
- ],
48
-
49
- /*
50
- generators: [
46
+ /*
47
+ {
48
+ id: "sortOrdering",
49
+ isA: ['adjective'],
50
+ bridge: "{ ...next(before[0]), ordering: 'ascending', ascending: operator, postModifiers: append(['ascending'], before[0].postModifiers) }"
51
+ },
51
52
  {
52
- where: where(),
53
- match: ({context}) => false && context.quantity,
54
- apply: ({context, g}) => {
55
- const countable = g({ ...context, quantity: undefined, number: context.quanity == 1 ? 'one' : 'many' })
56
- return `${g(context.quantity)} ${countable}`
57
- }
53
+ id: "descending",
54
+ isA: ['adjective'],
55
+ bridge: "{ ...next(before[0]), ordering: 'descending', descending: operator, postModifiers: append(['descending'], before[0].postModifiers) }"
58
56
  },
59
- ]
60
- */
57
+ */
58
+ ],
61
59
  };
62
60
 
63
- const createConfig = () => {
64
- const config = new Config(configStruct, module)
65
- config.add(dialogues(), numbers())
66
- return config
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
+ ],
67
80
  }
68
81
 
69
82
  knowledgeModule({
83
+ config,
84
+ includes: [dialogues, numbers, concept],
85
+ template: {
86
+ template,
87
+ instance: comparable_instance
88
+ },
89
+
70
90
  module,
71
91
  description: 'Comparable things',
72
- createConfig,
73
92
  test: {
74
93
  name: './comparable.test.json',
75
94
  contents: comparable_tests,
76
95
  checks: {
77
- context: defaultContextCheck,
78
- },
96
+ context: [...defaultContextCheck, 'ordering'],
97
+ },
79
98
  },
80
99
  })
@@ -63,6 +63,9 @@
63
63
  },
64
64
  "text": "highest comparable",
65
65
  "topLevel": true,
66
+ "types": [
67
+ "highest"
68
+ ],
66
69
  "value": "highest",
67
70
  "word": "highest"
68
71
  }
@@ -99,6 +102,10 @@
99
102
  [
100
103
  "comparable",
101
104
  0
105
+ ],
106
+ [
107
+ "compare",
108
+ 0
102
109
  ]
103
110
  ]
104
111
  },
@@ -119,29 +126,40 @@
119
126
  },
120
127
  "objects": {
121
128
  "nameToUUID": {
129
+ "articles": "articles2",
122
130
  "comparable": "comparable1",
123
131
  "dialogues": "dialogues2",
132
+ "evaluate": "evaluate2",
124
133
  "gdefaults": "gdefaults2",
125
134
  "meta": "meta2",
135
+ "negation": "negation2",
126
136
  "numbers": "numbers2",
127
137
  "pos": "pos2",
128
138
  "punctuation": "punctuation2",
129
139
  "sdefaults": "sdefaults2",
130
- "stm": "stm2"
140
+ "stm": "stm2",
141
+ "tokenize": "tokenize2"
131
142
  },
132
143
  "namespaced": {
144
+ "articles2": {
145
+ },
133
146
  "comparable1": {
134
147
  },
135
148
  "dialogues2": {
149
+ "idSuffix": "",
136
150
  "mentioned": [
137
151
  ],
138
152
  "variables": {
139
153
  }
140
154
  },
155
+ "evaluate2": {
156
+ },
141
157
  "gdefaults2": {
142
158
  },
143
159
  "meta2": {
144
160
  },
161
+ "negation2": {
162
+ },
145
163
  "numbers2": {
146
164
  },
147
165
  "pos2": {
@@ -155,6 +173,8 @@
155
173
  ],
156
174
  "variables": {
157
175
  }
176
+ },
177
+ "tokenize2": {
158
178
  }
159
179
  },
160
180
  "processed": [
@@ -207,6 +227,9 @@
207
227
  },
208
228
  "text": "highest comparable",
209
229
  "topLevel": true,
230
+ "types": [
231
+ "highest"
232
+ ],
210
233
  "value": "highest",
211
234
  "word": "highest"
212
235
  },
@@ -294,6 +317,9 @@
294
317
  },
295
318
  "text": "lowest comparable",
296
319
  "topLevel": true,
320
+ "types": [
321
+ "lowest"
322
+ ],
297
323
  "value": "lowest",
298
324
  "word": "lowest"
299
325
  }
@@ -330,6 +356,10 @@
330
356
  [
331
357
  "comparable",
332
358
  0
359
+ ],
360
+ [
361
+ "compare",
362
+ 0
333
363
  ]
334
364
  ]
335
365
  },
@@ -350,29 +380,40 @@
350
380
  },
351
381
  "objects": {
352
382
  "nameToUUID": {
383
+ "articles": "articles2",
353
384
  "comparable": "comparable1",
354
385
  "dialogues": "dialogues2",
386
+ "evaluate": "evaluate2",
355
387
  "gdefaults": "gdefaults2",
356
388
  "meta": "meta2",
389
+ "negation": "negation2",
357
390
  "numbers": "numbers2",
358
391
  "pos": "pos2",
359
392
  "punctuation": "punctuation2",
360
393
  "sdefaults": "sdefaults2",
361
- "stm": "stm2"
394
+ "stm": "stm2",
395
+ "tokenize": "tokenize2"
362
396
  },
363
397
  "namespaced": {
398
+ "articles2": {
399
+ },
364
400
  "comparable1": {
365
401
  },
366
402
  "dialogues2": {
403
+ "idSuffix": "",
367
404
  "mentioned": [
368
405
  ],
369
406
  "variables": {
370
407
  }
371
408
  },
409
+ "evaluate2": {
410
+ },
372
411
  "gdefaults2": {
373
412
  },
374
413
  "meta2": {
375
414
  },
415
+ "negation2": {
416
+ },
376
417
  "numbers2": {
377
418
  },
378
419
  "pos2": {
@@ -386,6 +427,8 @@
386
427
  ],
387
428
  "variables": {
388
429
  }
430
+ },
431
+ "tokenize2": {
389
432
  }
390
433
  },
391
434
  "processed": [
@@ -438,6 +481,9 @@
438
481
  },
439
482
  "text": "lowest comparable",
440
483
  "topLevel": true,
484
+ "types": [
485
+ "lowest"
486
+ ],
441
487
  "value": "lowest",
442
488
  "word": "lowest"
443
489
  },
@@ -460,5 +506,395 @@
460
506
  "responses": [
461
507
  ""
462
508
  ]
509
+ },
510
+ {
511
+ "associations": [
512
+ [
513
+ [
514
+ "comparable",
515
+ 0
516
+ ],
517
+ [
518
+ "descending",
519
+ 0
520
+ ]
521
+ ]
522
+ ],
523
+ "config": {
524
+ },
525
+ "contexts": [
526
+ {
527
+ "dead": true,
528
+ "default": true,
529
+ "descending": {
530
+ "default": true,
531
+ "level": 0,
532
+ "marker": "descending",
533
+ "range": {
534
+ "end": 20,
535
+ "start": 11
536
+ },
537
+ "text": "descending",
538
+ "value": "descending",
539
+ "word": "descending"
540
+ },
541
+ "level": 2,
542
+ "marker": "comparable",
543
+ "ordering": "descending",
544
+ "postModifiers": [
545
+ "descending"
546
+ ],
547
+ "range": {
548
+ "end": 20,
549
+ "start": 0
550
+ },
551
+ "text": "comparable descending",
552
+ "topLevel": true,
553
+ "types": [
554
+ "comparable"
555
+ ],
556
+ "value": "comparable",
557
+ "word": "comparable"
558
+ }
559
+ ],
560
+ "generatedParenthesized": [
561
+ ""
562
+ ],
563
+ "metadata": {
564
+ "opChoices": [
565
+ {
566
+ "counter": 1,
567
+ "op": [
568
+ "comparable",
569
+ 0
570
+ ],
571
+ "ops": [
572
+ [
573
+ "comparable",
574
+ 0
575
+ ],
576
+ [
577
+ "descending",
578
+ 0
579
+ ]
580
+ ]
581
+ },
582
+ {
583
+ "counter": 2,
584
+ "op": [
585
+ "descending",
586
+ 0
587
+ ],
588
+ "ops": [
589
+ [
590
+ "descending",
591
+ 0
592
+ ]
593
+ ]
594
+ }
595
+ ]
596
+ },
597
+ "objects": {
598
+ "nameToUUID": {
599
+ "articles": "articles2",
600
+ "comparable": "comparable1",
601
+ "dialogues": "dialogues2",
602
+ "evaluate": "evaluate2",
603
+ "gdefaults": "gdefaults2",
604
+ "meta": "meta2",
605
+ "negation": "negation2",
606
+ "numbers": "numbers2",
607
+ "pos": "pos2",
608
+ "punctuation": "punctuation2",
609
+ "sdefaults": "sdefaults2",
610
+ "stm": "stm2",
611
+ "tokenize": "tokenize2"
612
+ },
613
+ "namespaced": {
614
+ "articles2": {
615
+ },
616
+ "comparable1": {
617
+ },
618
+ "dialogues2": {
619
+ "idSuffix": "",
620
+ "mentioned": [
621
+ ],
622
+ "variables": {
623
+ }
624
+ },
625
+ "evaluate2": {
626
+ },
627
+ "gdefaults2": {
628
+ },
629
+ "meta2": {
630
+ },
631
+ "negation2": {
632
+ },
633
+ "numbers2": {
634
+ },
635
+ "pos2": {
636
+ },
637
+ "punctuation2": {
638
+ },
639
+ "sdefaults2": {
640
+ },
641
+ "stm2": {
642
+ "mentioned": [
643
+ ],
644
+ "variables": {
645
+ }
646
+ },
647
+ "tokenize2": {
648
+ }
649
+ },
650
+ "processed": [
651
+ {
652
+ "context": {
653
+ "dead": true,
654
+ "default": true,
655
+ "descending": {
656
+ "default": true,
657
+ "level": 0,
658
+ "marker": "descending",
659
+ "range": {
660
+ "end": 20,
661
+ "start": 11
662
+ },
663
+ "text": "descending",
664
+ "value": "descending",
665
+ "word": "descending"
666
+ },
667
+ "level": 2,
668
+ "marker": "comparable",
669
+ "ordering": "descending",
670
+ "postModifiers": [
671
+ "descending"
672
+ ],
673
+ "range": {
674
+ "end": 20,
675
+ "start": 0
676
+ },
677
+ "text": "comparable descending",
678
+ "topLevel": true,
679
+ "types": [
680
+ "comparable"
681
+ ],
682
+ "value": "comparable",
683
+ "word": "comparable"
684
+ },
685
+ "generatedParenthesized": "",
686
+ "paraphrases": "comparable descending",
687
+ "paraphrasesParenthesized": "((comparable) (descending))",
688
+ "responses": [
689
+ ""
690
+ ]
691
+ }
692
+ ]
693
+ },
694
+ "paraphrases": [
695
+ "comparable descending"
696
+ ],
697
+ "paraphrasesParenthesized": [
698
+ "((comparable) (descending))"
699
+ ],
700
+ "query": "comparable descending",
701
+ "responses": [
702
+ ""
703
+ ]
704
+ },
705
+ {
706
+ "associations": [
707
+ [
708
+ [
709
+ "ascending",
710
+ 0
711
+ ],
712
+ [
713
+ "comparable",
714
+ 0
715
+ ]
716
+ ]
717
+ ],
718
+ "config": {
719
+ },
720
+ "contexts": [
721
+ {
722
+ "ascending": {
723
+ "default": true,
724
+ "level": 0,
725
+ "marker": "ascending",
726
+ "range": {
727
+ "end": 19,
728
+ "start": 11
729
+ },
730
+ "text": "ascending",
731
+ "value": "ascending",
732
+ "word": "ascending"
733
+ },
734
+ "dead": true,
735
+ "default": true,
736
+ "level": 2,
737
+ "marker": "comparable",
738
+ "ordering": "ascending",
739
+ "postModifiers": [
740
+ "ascending"
741
+ ],
742
+ "range": {
743
+ "end": 19,
744
+ "start": 0
745
+ },
746
+ "text": "comparable ascending",
747
+ "topLevel": true,
748
+ "types": [
749
+ "comparable"
750
+ ],
751
+ "value": "comparable",
752
+ "word": "comparable"
753
+ }
754
+ ],
755
+ "generatedParenthesized": [
756
+ ""
757
+ ],
758
+ "metadata": {
759
+ "opChoices": [
760
+ {
761
+ "counter": 1,
762
+ "op": [
763
+ "comparable",
764
+ 0
765
+ ],
766
+ "ops": [
767
+ [
768
+ "ascending",
769
+ 0
770
+ ],
771
+ [
772
+ "comparable",
773
+ 0
774
+ ]
775
+ ]
776
+ },
777
+ {
778
+ "counter": 2,
779
+ "op": [
780
+ "ascending",
781
+ 0
782
+ ],
783
+ "ops": [
784
+ [
785
+ "ascending",
786
+ 0
787
+ ]
788
+ ]
789
+ }
790
+ ]
791
+ },
792
+ "objects": {
793
+ "nameToUUID": {
794
+ "articles": "articles2",
795
+ "comparable": "comparable1",
796
+ "dialogues": "dialogues2",
797
+ "evaluate": "evaluate2",
798
+ "gdefaults": "gdefaults2",
799
+ "meta": "meta2",
800
+ "negation": "negation2",
801
+ "numbers": "numbers2",
802
+ "pos": "pos2",
803
+ "punctuation": "punctuation2",
804
+ "sdefaults": "sdefaults2",
805
+ "stm": "stm2",
806
+ "tokenize": "tokenize2"
807
+ },
808
+ "namespaced": {
809
+ "articles2": {
810
+ },
811
+ "comparable1": {
812
+ },
813
+ "dialogues2": {
814
+ "idSuffix": "",
815
+ "mentioned": [
816
+ ],
817
+ "variables": {
818
+ }
819
+ },
820
+ "evaluate2": {
821
+ },
822
+ "gdefaults2": {
823
+ },
824
+ "meta2": {
825
+ },
826
+ "negation2": {
827
+ },
828
+ "numbers2": {
829
+ },
830
+ "pos2": {
831
+ },
832
+ "punctuation2": {
833
+ },
834
+ "sdefaults2": {
835
+ },
836
+ "stm2": {
837
+ "mentioned": [
838
+ ],
839
+ "variables": {
840
+ }
841
+ },
842
+ "tokenize2": {
843
+ }
844
+ },
845
+ "processed": [
846
+ {
847
+ "context": {
848
+ "ascending": {
849
+ "default": true,
850
+ "level": 0,
851
+ "marker": "ascending",
852
+ "range": {
853
+ "end": 19,
854
+ "start": 11
855
+ },
856
+ "text": "ascending",
857
+ "value": "ascending",
858
+ "word": "ascending"
859
+ },
860
+ "dead": true,
861
+ "default": true,
862
+ "level": 2,
863
+ "marker": "comparable",
864
+ "ordering": "ascending",
865
+ "postModifiers": [
866
+ "ascending"
867
+ ],
868
+ "range": {
869
+ "end": 19,
870
+ "start": 0
871
+ },
872
+ "text": "comparable ascending",
873
+ "topLevel": true,
874
+ "types": [
875
+ "comparable"
876
+ ],
877
+ "value": "comparable",
878
+ "word": "comparable"
879
+ },
880
+ "generatedParenthesized": "",
881
+ "paraphrases": "comparable ascending",
882
+ "paraphrasesParenthesized": "((comparable) (ascending))",
883
+ "responses": [
884
+ ""
885
+ ]
886
+ }
887
+ ]
888
+ },
889
+ "paraphrases": [
890
+ "comparable ascending"
891
+ ],
892
+ "paraphrasesParenthesized": [
893
+ "((comparable) (ascending))"
894
+ ],
895
+ "query": "comparable ascending",
896
+ "responses": [
897
+ ""
898
+ ]
463
899
  }
464
900
  ]