ekms 7.12.8 → 8.0.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/common/animals.instance.json +89 -293
  2. package/common/animals.js +1 -1
  3. package/common/avatar.js +7 -5
  4. package/common/characters.js +12 -5
  5. package/common/crew.instance.json +289 -577
  6. package/common/crew.js +1 -1
  7. package/common/currency.js +0 -2
  8. package/common/dialogues.js +122 -17
  9. package/common/dimension.instance.json +747 -73
  10. package/common/dimension.js +15 -7
  11. package/common/edible.instance.json +243 -435
  12. package/common/edible.js +1 -1
  13. package/common/emotions.instance.json +29 -65
  14. package/common/emotions.js +1 -1
  15. package/common/fastfood.instance.json +1080 -2072
  16. package/common/fastfood.js +1 -1
  17. package/common/formulas.instance.json +992 -0
  18. package/common/formulas.js +19 -6
  19. package/common/formulas.test.json +1187 -3651
  20. package/common/gdefaults.js +2 -0
  21. package/common/help.js +7 -2
  22. package/common/help.test.json +9 -5
  23. package/common/helpers.js +5 -0
  24. package/common/javascript.js +8 -6
  25. package/common/kirk.instance.json +1 -1
  26. package/common/kirk.js +1 -1
  27. package/common/length.instance.json +316 -740
  28. package/common/length.js +1 -1
  29. package/common/math.instance.json +1959 -1
  30. package/common/math.js +17 -5
  31. package/common/meta.instance.json +1 -1
  32. package/common/meta.js +35 -10
  33. package/common/numbers.js +28 -24
  34. package/common/ordering.instance.json +37 -153
  35. package/common/ordering.js +1 -1
  36. package/common/people.instance.json +50 -78
  37. package/common/people.js +1 -1
  38. package/common/pipboy.instance.json +23431 -1082
  39. package/common/pipboy.js +31 -4
  40. package/common/pipboy.test.json +13 -9
  41. package/common/pokemon.instance.json +41 -141
  42. package/common/pokemon.js +1 -1
  43. package/common/pressure.instance.json +93 -33
  44. package/common/pressure.js +1 -1
  45. package/common/properties.instance.json +21 -49
  46. package/common/properties.js +13 -8
  47. package/common/reports.instance.json +23 -63
  48. package/common/reports.js +9 -7
  49. package/common/scorekeeper.instance.json +1 -1
  50. package/common/scorekeeper.js +9 -7
  51. package/common/spock.instance.json +1 -1
  52. package/common/spock.js +1 -1
  53. package/common/tell.js +4 -2
  54. package/common/temperature.instance.json +97 -193
  55. package/common/temperature.js +1 -1
  56. package/common/time.js +36 -20
  57. package/common/time.test.json +66 -44
  58. package/common/tokenize.js +46 -0
  59. package/common/ui.instance.json +9 -1
  60. package/common/weight.instance.json +273 -217
  61. package/common/weight.js +1 -1
  62. package/main.js +4 -8
  63. package/package.json +6 -18
  64. package/common/dimensionTemplate.instance.json +0 -582
  65. package/common/dimensionTemplate.js +0 -35
  66. package/common/formulasTemplate.instance.json +0 -483
  67. package/common/formulasTemplate.js +0 -30
  68. package/common/formulasTemplate.test.json +0 -2
  69. package/common/mathTemplate.instance.json +0 -1635
  70. package/common/mathTemplate.js +0 -32
  71. package/common/mathTemplate.test.json +0 -1422
  72. package/common/pipboyTemplate.instance.json +0 -17420
  73. package/common/pipboyTemplate.js +0 -48
  74. package/common/pipboyTemplate.test.json +0 -2
  75. /package/common/{dimensionTemplate.test.json → tokenize.test.json} +0 -0
@@ -7,7 +7,7 @@
7
7
  0
8
8
  ],
9
9
  [
10
- "hourUnits",
10
+ "number",
11
11
  0
12
12
  ]
13
13
  ]
@@ -21,17 +21,18 @@
21
21
  "determined": true,
22
22
  "hour": {
23
23
  "dead": true,
24
- "hour": 2,
24
+ "instance": true,
25
25
  "level": 1,
26
- "marker": "hourUnits",
26
+ "marker": "number",
27
27
  "range": {
28
28
  "end": 0,
29
29
  "start": 0
30
30
  },
31
31
  "text": "2",
32
32
  "types": [
33
- "hourUnits"
33
+ "number"
34
34
  ],
35
+ "value": 2,
35
36
  "word": "2"
36
37
  },
37
38
  "level": 1,
@@ -53,7 +54,7 @@
53
54
  {
54
55
  "counter": 1,
55
56
  "op": [
56
- "hourUnits",
57
+ "number",
57
58
  0
58
59
  ],
59
60
  "ops": [
@@ -62,7 +63,7 @@
62
63
  0
63
64
  ],
64
65
  [
65
- "hourUnits",
66
+ "number",
66
67
  0
67
68
  ]
68
69
  ]
@@ -87,6 +88,7 @@
87
88
  "dialogues": "dialogues2",
88
89
  "gdefaults": "gdefaults2",
89
90
  "meta": "meta2",
91
+ "numbers": "numbers2",
90
92
  "pos": "pos2",
91
93
  "punctuation": "punctuation2",
92
94
  "sdefaults": "sdefaults2",
@@ -105,6 +107,8 @@
105
107
  },
106
108
  "meta2": {
107
109
  },
110
+ "numbers2": {
111
+ },
108
112
  "pos2": {
109
113
  },
110
114
  "punctuation2": {
@@ -131,17 +135,18 @@
131
135
  "determined": true,
132
136
  "hour": {
133
137
  "dead": true,
134
- "hour": 2,
138
+ "instance": true,
135
139
  "level": 1,
136
- "marker": "hourUnits",
140
+ "marker": "number",
137
141
  "range": {
138
142
  "end": 0,
139
143
  "start": 0
140
144
  },
141
145
  "text": "2",
142
146
  "types": [
143
- "hourUnits"
147
+ "number"
144
148
  ],
149
+ "value": 2,
145
150
  "word": "2"
146
151
  },
147
152
  "level": 1,
@@ -156,7 +161,7 @@
156
161
  },
157
162
  "generatedParenthesized": "",
158
163
  "paraphrases": "2 pm",
159
- "paraphrasesParenthesized": "(2 pm)",
164
+ "paraphrasesParenthesized": "((2) pm)",
160
165
  "responses": [
161
166
  ""
162
167
  ]
@@ -167,7 +172,7 @@
167
172
  "2 pm"
168
173
  ],
169
174
  "paraphrasesParenthesized": [
170
- "(2 pm)"
175
+ "((2) pm)"
171
176
  ],
172
177
  "query": "2 pm",
173
178
  "responses": [
@@ -182,15 +187,15 @@
182
187
  0
183
188
  ],
184
189
  [
185
- "hourUnits",
190
+ "info",
186
191
  0
187
192
  ],
188
193
  [
189
- "info",
194
+ "is",
190
195
  0
191
196
  ],
192
197
  [
193
- "is",
198
+ "number",
194
199
  0
195
200
  ],
196
201
  [
@@ -216,15 +221,15 @@
216
221
  0
217
222
  ],
218
223
  [
219
- "hourUnits",
224
+ "info",
220
225
  0
221
226
  ],
222
227
  [
223
- "info",
228
+ "is",
224
229
  0
225
230
  ],
226
231
  [
227
- "is",
232
+ "number",
228
233
  0
229
234
  ],
230
235
  [
@@ -246,11 +251,11 @@
246
251
  0
247
252
  ],
248
253
  [
249
- "hourUnits",
254
+ "is",
250
255
  0
251
256
  ],
252
257
  [
253
- "is",
258
+ "number",
254
259
  0
255
260
  ],
256
261
  [
@@ -264,11 +269,11 @@
264
269
  0
265
270
  ],
266
271
  [
267
- "hourUnits",
272
+ "is",
268
273
  0
269
274
  ],
270
275
  [
271
- "is",
276
+ "number",
272
277
  0
273
278
  ],
274
279
  [
@@ -286,11 +291,11 @@
286
291
  0
287
292
  ],
288
293
  [
289
- "hourUnits",
294
+ "is",
290
295
  0
291
296
  ],
292
297
  [
293
- "is",
298
+ "number",
294
299
  0
295
300
  ],
296
301
  [
@@ -405,17 +410,18 @@
405
410
  "determined": true,
406
411
  "hour": {
407
412
  "dead": true,
408
- "hour": 2,
413
+ "instance": true,
409
414
  "level": 1,
410
- "marker": "hourUnits",
415
+ "marker": "number",
411
416
  "range": {
412
417
  "end": 25,
413
418
  "start": 25
414
419
  },
415
420
  "text": "2",
416
421
  "types": [
417
- "hourUnits"
422
+ "number"
418
423
  ],
424
+ "value": 2,
419
425
  "word": "2"
420
426
  },
421
427
  "level": 1,
@@ -497,15 +503,15 @@
497
503
  0
498
504
  ],
499
505
  [
500
- "hourUnits",
506
+ "info",
501
507
  0
502
508
  ],
503
509
  [
504
- "info",
510
+ "is",
505
511
  0
506
512
  ],
507
513
  [
508
- "is",
514
+ "number",
509
515
  0
510
516
  ],
511
517
  [
@@ -538,15 +544,15 @@
538
544
  0
539
545
  ],
540
546
  [
541
- "hourUnits",
547
+ "info",
542
548
  0
543
549
  ],
544
550
  [
545
- "info",
551
+ "is",
546
552
  0
547
553
  ],
548
554
  [
549
- "is",
555
+ "number",
550
556
  0
551
557
  ],
552
558
  [
@@ -575,11 +581,11 @@
575
581
  0
576
582
  ],
577
583
  [
578
- "hourUnits",
584
+ "is",
579
585
  0
580
586
  ],
581
587
  [
582
- "is",
588
+ "number",
583
589
  0
584
590
  ],
585
591
  [
@@ -608,11 +614,11 @@
608
614
  0
609
615
  ],
610
616
  [
611
- "hourUnits",
617
+ "is",
612
618
  0
613
619
  ],
614
620
  [
615
- "is",
621
+ "number",
616
622
  0
617
623
  ],
618
624
  [
@@ -628,7 +634,7 @@
628
634
  {
629
635
  "counter": 5,
630
636
  "op": [
631
- "hourUnits",
637
+ "number",
632
638
  0
633
639
  ],
634
640
  "ops": [
@@ -637,11 +643,11 @@
637
643
  0
638
644
  ],
639
645
  [
640
- "hourUnits",
646
+ "is",
641
647
  0
642
648
  ],
643
649
  [
644
- "is",
650
+ "number",
645
651
  0
646
652
  ],
647
653
  [
@@ -712,6 +718,7 @@
712
718
  "dialogues": "dialogues2",
713
719
  "gdefaults": "gdefaults2",
714
720
  "meta": "meta2",
721
+ "numbers": "numbers2",
715
722
  "pos": "pos2",
716
723
  "punctuation": "punctuation2",
717
724
  "sdefaults": "sdefaults2",
@@ -730,6 +737,8 @@
730
737
  },
731
738
  "meta2": {
732
739
  },
740
+ "numbers2": {
741
+ },
733
742
  "pos2": {
734
743
  },
735
744
  "punctuation2": {
@@ -793,17 +802,18 @@
793
802
  "determined": true,
794
803
  "hour": {
795
804
  "dead": true,
796
- "hour": 2,
805
+ "instance": true,
797
806
  "level": 1,
798
- "marker": "hourUnits",
807
+ "marker": "number",
799
808
  "range": {
800
809
  "end": 25,
801
810
  "start": 25
802
811
  },
803
812
  "text": "2",
804
813
  "types": [
805
- "hourUnits"
814
+ "number"
806
815
  ],
816
+ "value": 2,
807
817
  "word": "2"
808
818
  },
809
819
  "level": 1,
@@ -869,7 +879,7 @@
869
879
  },
870
880
  "generatedParenthesized": "",
871
881
  "paraphrases": "tell me when the time is 2 pm",
872
- "paraphrasesParenthesized": "(tell (me) when ((the (time)) is (2 pm)))",
882
+ "paraphrasesParenthesized": "(tell (me) when ((the (time)) is ((2) pm)))",
873
883
  "responses": [
874
884
  ""
875
885
  ]
@@ -880,7 +890,7 @@
880
890
  "tell me when the time is 2 pm"
881
891
  ],
882
892
  "paraphrasesParenthesized": [
883
- "(tell (me) when ((the (time)) is (2 pm)))"
893
+ "(tell (me) when ((the (time)) is ((2) pm)))"
884
894
  ],
885
895
  "query": "tell me when the time is 2 pm",
886
896
  "responses": [
@@ -1386,6 +1396,7 @@
1386
1396
  "dialogues": "dialogues2",
1387
1397
  "gdefaults": "gdefaults2",
1388
1398
  "meta": "meta2",
1399
+ "numbers": "numbers2",
1389
1400
  "pos": "pos2",
1390
1401
  "punctuation": "punctuation2",
1391
1402
  "sdefaults": "sdefaults2",
@@ -1404,6 +1415,8 @@
1404
1415
  },
1405
1416
  "meta2": {
1406
1417
  },
1418
+ "numbers2": {
1419
+ },
1407
1420
  "pos2": {
1408
1421
  },
1409
1422
  "punctuation2": {
@@ -2122,6 +2135,7 @@
2122
2135
  "dialogues": "dialogues2",
2123
2136
  "gdefaults": "gdefaults2",
2124
2137
  "meta": "meta2",
2138
+ "numbers": "numbers2",
2125
2139
  "pos": "pos2",
2126
2140
  "punctuation": "punctuation2",
2127
2141
  "sdefaults": "sdefaults2",
@@ -2140,6 +2154,8 @@
2140
2154
  },
2141
2155
  "meta2": {
2142
2156
  },
2157
+ "numbers2": {
2158
+ },
2143
2159
  "pos2": {
2144
2160
  },
2145
2161
  "punctuation2": {
@@ -2531,6 +2547,7 @@
2531
2547
  "dialogues": "dialogues2",
2532
2548
  "gdefaults": "gdefaults2",
2533
2549
  "meta": "meta2",
2550
+ "numbers": "numbers2",
2534
2551
  "pos": "pos2",
2535
2552
  "punctuation": "punctuation2",
2536
2553
  "sdefaults": "sdefaults2",
@@ -2549,6 +2566,8 @@
2549
2566
  },
2550
2567
  "meta2": {
2551
2568
  },
2569
+ "numbers2": {
2570
+ },
2552
2571
  "pos2": {
2553
2572
  },
2554
2573
  "punctuation2": {
@@ -2905,6 +2924,7 @@
2905
2924
  "dialogues": "dialogues2",
2906
2925
  "gdefaults": "gdefaults2",
2907
2926
  "meta": "meta2",
2927
+ "numbers": "numbers2",
2908
2928
  "pos": "pos2",
2909
2929
  "punctuation": "punctuation2",
2910
2930
  "sdefaults": "sdefaults2",
@@ -2923,6 +2943,8 @@
2923
2943
  },
2924
2944
  "meta2": {
2925
2945
  },
2946
+ "numbers2": {
2947
+ },
2926
2948
  "pos2": {
2927
2949
  },
2928
2950
  "punctuation2": {
@@ -0,0 +1,46 @@
1
+ const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
2
+ const { defaultContextCheck } = require('./helpers')
3
+ const tokenize_tests = require('./tokenize.test.json')
4
+
5
+ let configStruct = {
6
+ name: 'tokenize',
7
+ operators: [
8
+ "([unknown])",
9
+ ],
10
+ bridges: [
11
+ { id: "unknown", level: 0, bridge: "{ ...next(operator), unknown: true, dead: true }" },
12
+ { id: "unknown", level: 1, bridge: "{ ...next(operator) }" },
13
+ ],
14
+ words: {
15
+ patterns: [
16
+ { pattern: [{ type: 'space' }, { repeat: true }], defs: [ { remove: true } ] },
17
+ { pattern: [{ type: 'alphanumeric' }, { repeat: true }], defs: [ { id: 'unknown', initial: "{ value: text, unknown: true }" } ] },
18
+ ],
19
+ hierarchy: [
20
+ { child: ' ', parent: 'space' },
21
+ ..."0123456789".split("").map((digit) => { return { child: digit, parent: 'digit' } }),
22
+ { child: 'lower', parent: 'letter' },
23
+ { child: 'upper', parent: 'letter' },
24
+ ...'abcdefghijklmnopqrstuvwxyz'.split("").map((letter) => { return { child: letter, parent: 'lower' } }),
25
+ ...'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split("").map((letter) => { return { child: letter, parent: 'upper' } }),
26
+ { child: 'letter', parent: 'alphanumeric' },
27
+ { child: 'digit', parent: 'alphanumeric' },
28
+ ...`~!@#$%^&*()_+-=[]{}\\|;:,<>/?'"`.split("").map((punctuation) => { return { child: punctuation, parent: 'punctuation' } }),
29
+ ],
30
+ },
31
+ };
32
+
33
+ createConfig = () => new Config(configStruct, module)
34
+
35
+ knowledgeModule( {
36
+ module,
37
+ createConfig,
38
+ description: 'tokenize',
39
+ test: {
40
+ name: './tokenize.test.json',
41
+ contents: tokenize_tests,
42
+ checks: {
43
+ context: defaultContextCheck,
44
+ },
45
+ },
46
+ })
@@ -1,5 +1,5 @@
1
1
  {
2
- "queries": [],
2
+ "configs": [],
3
3
  "resultss": [],
4
4
  "fragments": [
5
5
  {
@@ -604,9 +604,17 @@
604
604
  "whose",
605
605
  "object"
606
606
  ],
607
+ [
608
+ "x",
609
+ "number"
610
+ ],
607
611
  [
608
612
  "xfx",
609
613
  "queryable"
614
+ ],
615
+ [
616
+ "y",
617
+ "number"
610
618
  ]
611
619
  ],
612
620
  "metadata": {