tpmkms_4wp 8.9.1-beta.2 → 8.9.1-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/common/animals.instance.json +348 -68
  2. package/common/articles.js +20 -4
  3. package/common/articles.test.json +338 -0
  4. package/common/asking.js +3 -3
  5. package/common/asking.test.json +41 -0
  6. package/common/avatar.js +1 -1
  7. package/common/characters.js +1 -1
  8. package/common/colors.instance.json +608 -113
  9. package/common/comparable.instance.json +60 -12
  10. package/common/comparable.js +2 -2
  11. package/common/concept.js +2 -2
  12. package/common/conjunction.js +1 -1
  13. package/common/countable.js +3 -9
  14. package/common/countable.test.json +0 -586
  15. package/common/crew.instance.json +520 -392
  16. package/common/currency.js +2 -2
  17. package/common/dialogues.js +28 -11
  18. package/common/dimension.instance.json +16 -8
  19. package/common/dimension.js +2 -2
  20. package/common/edible.instance.json +595 -229
  21. package/common/emotions.instance.json +20 -4
  22. package/common/errors.js +3 -1
  23. package/common/events.js +1 -1
  24. package/common/fastfood.instance.json +2095 -1498
  25. package/common/fastfood.js +16 -10
  26. package/common/formulas.instance.json +16 -5
  27. package/common/formulas.js +1 -1
  28. package/common/formulas.test.json +461 -10
  29. package/common/gdefaults.js +27 -14
  30. package/common/help.js +4 -4
  31. package/common/help.test.json +4 -4
  32. package/common/helpers/concept.js +5 -5
  33. package/common/helpers/conjunction.js +1 -1
  34. package/common/helpers/formulas.js +4 -4
  35. package/common/helpers/frankenhash.js +4 -4
  36. package/common/helpers/meta.js +4 -4
  37. package/common/helpers/ordering.js +2 -2
  38. package/common/helpers/properties.js +17 -17
  39. package/common/helpers.js +17 -1
  40. package/common/hierarchy.js +3 -3
  41. package/common/javascript.js +1 -1
  42. package/common/kirk.instance.json +20 -4
  43. package/common/length.instance.json +300 -80
  44. package/common/math.instance.json +16 -5
  45. package/common/math.js +1 -1
  46. package/common/meta.js +5 -5
  47. package/common/nameable.js +1 -1
  48. package/common/negation.js +1 -1
  49. package/common/numbers.js +1 -1
  50. package/common/ordering.instance.json +41 -11
  51. package/common/ordinals.js +9 -3
  52. package/common/ordinals.test.json +327 -0
  53. package/common/people.instance.json +228 -80
  54. package/common/people.js +1 -1
  55. package/common/percentages.js +1 -1
  56. package/common/pipboy.instance.json +334 -180
  57. package/common/pipboy.js +6 -6
  58. package/common/pokemon.instance.json +304 -57
  59. package/common/pos.js +16 -6
  60. package/common/pressure.instance.json +64 -23
  61. package/common/properties.instance.json +20 -4
  62. package/common/properties.js +6 -6
  63. package/common/punctuation.js +1 -1
  64. package/common/reports.instance.json +34 -12
  65. package/common/reports.js +9 -9
  66. package/common/scorekeeper.js +5 -5
  67. package/common/sdefaults.js +2 -2
  68. package/common/sizeable.js +2 -2
  69. package/common/spock.instance.json +20 -4
  70. package/common/stm.js +6 -6
  71. package/common/tell.js +1 -1
  72. package/common/temperature.instance.json +64 -24
  73. package/common/tester.js +1 -1
  74. package/common/ui.instance.json +21 -5
  75. package/common/weight.instance.json +261 -109
  76. package/common/wp.instance.json +6621 -404
  77. package/common/wp.js +199 -41
  78. package/common/wp.test.json +109575 -3828
  79. package/common/yesno.js +1 -1
  80. package/package.json +11 -6
@@ -211,7 +211,7 @@
211
211
  "hierarchy": [
212
212
  [
213
213
  "a",
214
- "articlePOS",
214
+ "article",
215
215
  false
216
216
  ],
217
217
  [
@@ -225,8 +225,8 @@
225
225
  false
226
226
  ],
227
227
  [
228
- "articlePOS",
229
- "articlePOS",
228
+ "article",
229
+ "article",
230
230
  false
231
231
  ],
232
232
  [
@@ -344,11 +344,21 @@
344
344
  "theAble",
345
345
  false
346
346
  ],
347
+ [
348
+ "distributable",
349
+ "queryable",
350
+ false
351
+ ],
347
352
  [
348
353
  "doubleQuote",
349
354
  "queryable",
350
355
  false
351
356
  ],
357
+ [
358
+ "each",
359
+ "article",
360
+ false
361
+ ],
352
362
  [
353
363
  "evaluate",
354
364
  "verb",
@@ -356,7 +366,7 @@
356
366
  ],
357
367
  [
358
368
  "every",
359
- "quantifier",
369
+ "article",
360
370
  false
361
371
  ],
362
372
  [
@@ -701,7 +711,7 @@
701
711
  ],
702
712
  [
703
713
  "the",
704
- "articlePOS",
714
+ "article",
705
715
  false
706
716
  ],
707
717
  [
@@ -892,6 +902,7 @@
892
902
  "level": 1
893
903
  },
894
904
  "level": 1,
905
+ "context_index": 1,
895
906
  "topLevel": true,
896
907
  "touchedBy": [
897
908
  "math#call2"
package/common/math.js CHANGED
@@ -69,7 +69,7 @@ const mathematicalOperator = (name, words, apply, before = []) => [
69
69
  }
70
70
  ]
71
71
 
72
- let config = {
72
+ const config = {
73
73
  name: 'math',
74
74
  operators: [
75
75
  "([mathematicalExpression])",
package/common/meta.js CHANGED
@@ -17,7 +17,7 @@ const template = {
17
17
  };
18
18
 
19
19
  // TODO -> if a car's top speed is over 200 mph then the car is fast
20
- let config = {
20
+ const config = {
21
21
  name: 'meta',
22
22
  operators: [
23
23
  "((phrase) [means] (phrase))",
@@ -208,7 +208,7 @@ let config = {
208
208
  //const mappings = mappingss[0]
209
209
  let toPrimes = []
210
210
  for (const [TO, mappings] of zip(DEFINITIONs, mappingss)) {
211
- for (let { from, to } of invertMappings(mappings)) {
211
+ for (const { from, to } of invertMappings(mappings)) {
212
212
  hashIndexesSet(TO, to, hashIndexesGet(context, from))
213
213
  }
214
214
  // next move add debug arg to s and g
@@ -236,7 +236,7 @@ let config = {
236
236
  for (const [relations, mappings] of toPrimes) {
237
237
  for (const relation of relations.evalue.value) {
238
238
  valuePrime = _.cloneDeep(DERIVED)
239
- for (let { from, to } of mappings) {
239
+ for (const { from, to } of mappings) {
240
240
  hashIndexesSet(valuePrime, to, hashIndexesGet(relation, from))
241
241
  }
242
242
  valuePrime.paraphrase = true
@@ -303,7 +303,7 @@ let config = {
303
303
  const matchByValue = (defContext) => ({context}) => context.evalue == defContext.from.value && !context.query && !context.objects
304
304
  const apply = (mappings, TO) => async ({context, s}) => {
305
305
  TO = _.cloneDeep(TO)
306
- for (let { from, to } of mappings) {
306
+ for (const { from, to } of mappings) {
307
307
  hashIndexesSet(TO, to, hashIndexesGet(context, from))
308
308
  }
309
309
  toPrime = await s(TO)
@@ -330,7 +330,7 @@ let config = {
330
330
  const matchByValue = (defContext) => ({context, uuid}) => context.value == defContext.from.value && (context.query || context.evaluate) && !context[`disable${uuid}`]
331
331
  const apply = (mappings, TO) => async ({uuid, context, s, g, config}) => {
332
332
  TO = _.cloneDeep(TO)
333
- for (let { from, to } of mappings) {
333
+ for (const { from, to } of mappings) {
334
334
  hashIndexesSet(TO, to, hashIndexesGet(context, from))
335
335
  }
336
336
  // next move add debug arg to s and g
@@ -106,7 +106,7 @@ const config = {
106
106
  {
107
107
  id: 'call',
108
108
  isA: ['verb'],
109
- bridge: "{ ...next(operator), nameable: after[0], name: after[1:] }",
109
+ bridge: "{ ...next(operator), nameable: after[0], name: after[1:][0] }",
110
110
  // bridge: "{ ...next(operator), nameable: after[0], name: after[1] }",
111
111
  // generatorp: async ({context, g}) => `call ${await g(context.nameable)} ${await g(context.name)}`,
112
112
  generatorp: async ({context, g, gs}) => `call ${await g(context.nameable)} ${await gs(context.name)}`,
@@ -4,7 +4,7 @@ const gdefaults = require('./gdefaults')
4
4
  const pos = require('./pos')
5
5
  const negation_tests = require('./negation.test.json')
6
6
 
7
- let config = {
7
+ const config = {
8
8
  name: 'negation',
9
9
  operators: [
10
10
  "([negatable])",
package/common/numbers.js CHANGED
@@ -10,7 +10,7 @@ const sdefaults = require('./sdefaults')
10
10
  10 million 300 hundred and fifty
11
11
  */
12
12
 
13
- let config = {
13
+ const config = {
14
14
  name: 'numbers',
15
15
  operators: [
16
16
  "([number])",
@@ -8,7 +8,7 @@
8
8
  "hierarchy": [
9
9
  [
10
10
  "a",
11
- "articlePOS",
11
+ "article",
12
12
  false
13
13
  ],
14
14
  [
@@ -17,8 +17,8 @@
17
17
  false
18
18
  ],
19
19
  [
20
- "articlePOS",
21
- "articlePOS",
20
+ "article",
21
+ "article",
22
22
  false
23
23
  ],
24
24
  [
@@ -66,16 +66,31 @@
66
66
  "orAble",
67
67
  false
68
68
  ],
69
+ [
70
+ "distributable",
71
+ "queryable",
72
+ false
73
+ ],
69
74
  [
70
75
  "doubleQuote",
71
76
  "queryable",
72
77
  false
73
78
  ],
79
+ [
80
+ "each",
81
+ "article",
82
+ false
83
+ ],
74
84
  [
75
85
  "evaluate",
76
86
  "verb",
77
87
  false
78
88
  ],
89
+ [
90
+ "every",
91
+ "article",
92
+ false
93
+ ],
79
94
  [
80
95
  "hate",
81
96
  "canBeDoQuestion",
@@ -293,7 +308,7 @@
293
308
  ],
294
309
  [
295
310
  "the",
296
- "articlePOS",
311
+ "article",
297
312
  false
298
313
  ],
299
314
  [
@@ -650,7 +665,7 @@
650
665
  },
651
666
  "types": [
652
667
  "list",
653
- "queryable"
668
+ "unknown"
654
669
  ],
655
670
  "listable": true,
656
671
  "isList": true,
@@ -666,7 +681,6 @@
666
681
  "end": 26
667
682
  },
668
683
  "types": [
669
- "queryable",
670
684
  "unknown"
671
685
  ],
672
686
  "dead": true,
@@ -683,7 +697,6 @@
683
697
  "end": 37
684
698
  },
685
699
  "types": [
686
- "queryable",
687
700
  "unknown"
688
701
  ],
689
702
  "dead": true,
@@ -696,6 +709,7 @@
696
709
  },
697
710
  "dead": true,
698
711
  "level": 2,
712
+ "context_index": 1,
699
713
  "topLevel": true,
700
714
  "touchedBy": [
701
715
  "ordering#call2"
@@ -885,7 +899,7 @@
885
899
  "hierarchy": [
886
900
  [
887
901
  "a",
888
- "articlePOS",
902
+ "article",
889
903
  false
890
904
  ],
891
905
  [
@@ -894,8 +908,8 @@
894
908
  false
895
909
  ],
896
910
  [
897
- "articlePOS",
898
- "articlePOS",
911
+ "article",
912
+ "article",
899
913
  false
900
914
  ],
901
915
  [
@@ -943,16 +957,31 @@
943
957
  "orAble",
944
958
  false
945
959
  ],
960
+ [
961
+ "distributable",
962
+ "queryable",
963
+ false
964
+ ],
946
965
  [
947
966
  "doubleQuote",
948
967
  "queryable",
949
968
  false
950
969
  ],
970
+ [
971
+ "each",
972
+ "article",
973
+ false
974
+ ],
951
975
  [
952
976
  "evaluate",
953
977
  "verb",
954
978
  false
955
979
  ],
980
+ [
981
+ "every",
982
+ "article",
983
+ false
984
+ ],
956
985
  [
957
986
  "hate",
958
987
  "canBeDoQuestion",
@@ -1170,7 +1199,7 @@
1170
1199
  ],
1171
1200
  [
1172
1201
  "the",
1173
- "articlePOS",
1202
+ "article",
1174
1203
  false
1175
1204
  ],
1176
1205
  [
@@ -2014,6 +2043,7 @@
2014
2043
  "level": 1
2015
2044
  },
2016
2045
  "level": 1,
2046
+ "context_index": 1,
2017
2047
  "topLevel": true,
2018
2048
  "touchedBy": [
2019
2049
  "ordering#call2"
@@ -1,10 +1,11 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const ordinals_tests = require('./ordinals.test.json')
4
+ const articles = require('./articles')
4
5
  const numbers = require('./numbers')
5
6
  const pos = require('./pos')
6
7
 
7
- let config = {
8
+ const config = {
8
9
  name: 'ordinals',
9
10
  operators: [
10
11
  "([ordinal])",
@@ -18,12 +19,14 @@ let config = {
18
19
  },
19
20
  {
20
21
  id: "orderable",
21
- bridge: "{ ...next(operator) }"
22
+ bridge: "{ ...next(operator) }",
23
+ isA: ['queryable'],
22
24
  },
23
25
  {
24
26
  id: "ordinalOnOrdered",
25
27
  isA: ['adjective'],
26
28
  convolution: true,
29
+ // bridge: "{ ...after[0], ordinal: before[0], modifiers: append(['ordinal'], after[0].modifiers), generate: append(['ordinal'], or(after[0].generate, after)) }"
27
30
  bridge: "{ ...after[0], ordinal: before[0], modifiers: append(['ordinal'], after[0].modifiers) }"
28
31
  },
29
32
  ],
@@ -39,13 +42,16 @@ let config = {
39
42
  },
40
43
  patterns: [
41
44
  { "pattern": [{ type: 'digit' }, { repeat: true }, 'th'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, instance: true }" }]},
45
+ { "pattern": [{ type: 'digit' }, { repeat: true }, '1st'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, instance: true }" }]},
46
+ { "pattern": [{ type: 'digit' }, { repeat: true }, '2nd'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, instance: true }" }]},
47
+ { "pattern": [{ type: 'digit' }, { repeat: true }, '3rd'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, instance: true }" }]},
42
48
  ],
43
49
  },
44
50
  };
45
51
 
46
52
  knowledgeModule( {
47
53
  config,
48
- includes: [pos, numbers],
54
+ includes: [pos, numbers, articles],
49
55
 
50
56
  module,
51
57
  description: 'talking about ordinals',
@@ -408,5 +408,332 @@
408
408
  "responses": [
409
409
  ""
410
410
  ]
411
+ },
412
+ {
413
+ "associations": [
414
+ ],
415
+ "config": {
416
+ },
417
+ "contexts": [
418
+ {
419
+ "dead": true,
420
+ "instance": true,
421
+ "level": 1,
422
+ "marker": "ordinal",
423
+ "ordinal": true,
424
+ "range": {
425
+ "end": 3,
426
+ "start": 0
427
+ },
428
+ "text": "23rd",
429
+ "topLevel": true,
430
+ "value": 23,
431
+ "word": "23rd"
432
+ }
433
+ ],
434
+ "developerTest": false,
435
+ "generatedParenthesized": [
436
+ ""
437
+ ],
438
+ "metadata": {
439
+ "opChoices": [
440
+ {
441
+ "counter": 1,
442
+ "op": [
443
+ "ordinal",
444
+ 0
445
+ ],
446
+ "ops": [
447
+ [
448
+ "ordinal",
449
+ 0
450
+ ]
451
+ ]
452
+ }
453
+ ]
454
+ },
455
+ "objects": {
456
+ "nameToUUID": {
457
+ "articles": "articles2",
458
+ "gdefaults": "gdefaults2",
459
+ "numbers": "numbers2",
460
+ "ordinals": "ordinals1",
461
+ "pos": "pos2",
462
+ "punctuation": "punctuation2",
463
+ "sdefaults": "sdefaults2",
464
+ "tokenize": "tokenize2"
465
+ },
466
+ "namespaced": {
467
+ "articles2": {
468
+ },
469
+ "gdefaults2": {
470
+ },
471
+ "numbers2": {
472
+ },
473
+ "ordinals1": {
474
+ },
475
+ "pos2": {
476
+ },
477
+ "punctuation2": {
478
+ },
479
+ "sdefaults2": {
480
+ },
481
+ "tokenize2": {
482
+ }
483
+ },
484
+ "processed": [
485
+ {
486
+ "context": {
487
+ "dead": true,
488
+ "instance": true,
489
+ "level": 1,
490
+ "marker": "ordinal",
491
+ "ordinal": true,
492
+ "range": {
493
+ "end": 3,
494
+ "start": 0
495
+ },
496
+ "text": "23rd",
497
+ "topLevel": true,
498
+ "value": 23,
499
+ "word": "23rd"
500
+ },
501
+ "generatedParenthesized": "",
502
+ "paraphrases": "23rd",
503
+ "paraphrasesParenthesized": "(23rd)",
504
+ "responses": [
505
+ ""
506
+ ]
507
+ }
508
+ ]
509
+ },
510
+ "paraphrases": [
511
+ "23rd"
512
+ ],
513
+ "paraphrasesParenthesized": [
514
+ "(23rd)"
515
+ ],
516
+ "query": "23rd",
517
+ "responses": [
518
+ ""
519
+ ]
520
+ },
521
+ {
522
+ "associations": [
523
+ ],
524
+ "config": {
525
+ },
526
+ "contexts": [
527
+ {
528
+ "dead": true,
529
+ "instance": true,
530
+ "level": 1,
531
+ "marker": "ordinal",
532
+ "ordinal": true,
533
+ "range": {
534
+ "end": 3,
535
+ "start": 0
536
+ },
537
+ "text": "22nd",
538
+ "topLevel": true,
539
+ "value": 22,
540
+ "word": "22nd"
541
+ }
542
+ ],
543
+ "developerTest": false,
544
+ "generatedParenthesized": [
545
+ ""
546
+ ],
547
+ "metadata": {
548
+ "opChoices": [
549
+ {
550
+ "counter": 1,
551
+ "op": [
552
+ "ordinal",
553
+ 0
554
+ ],
555
+ "ops": [
556
+ [
557
+ "ordinal",
558
+ 0
559
+ ]
560
+ ]
561
+ }
562
+ ]
563
+ },
564
+ "objects": {
565
+ "nameToUUID": {
566
+ "articles": "articles2",
567
+ "gdefaults": "gdefaults2",
568
+ "numbers": "numbers2",
569
+ "ordinals": "ordinals1",
570
+ "pos": "pos2",
571
+ "punctuation": "punctuation2",
572
+ "sdefaults": "sdefaults2",
573
+ "tokenize": "tokenize2"
574
+ },
575
+ "namespaced": {
576
+ "articles2": {
577
+ },
578
+ "gdefaults2": {
579
+ },
580
+ "numbers2": {
581
+ },
582
+ "ordinals1": {
583
+ },
584
+ "pos2": {
585
+ },
586
+ "punctuation2": {
587
+ },
588
+ "sdefaults2": {
589
+ },
590
+ "tokenize2": {
591
+ }
592
+ },
593
+ "processed": [
594
+ {
595
+ "context": {
596
+ "dead": true,
597
+ "instance": true,
598
+ "level": 1,
599
+ "marker": "ordinal",
600
+ "ordinal": true,
601
+ "range": {
602
+ "end": 3,
603
+ "start": 0
604
+ },
605
+ "text": "22nd",
606
+ "topLevel": true,
607
+ "value": 22,
608
+ "word": "22nd"
609
+ },
610
+ "generatedParenthesized": "",
611
+ "paraphrases": "22nd",
612
+ "paraphrasesParenthesized": "(22nd)",
613
+ "responses": [
614
+ ""
615
+ ]
616
+ }
617
+ ]
618
+ },
619
+ "paraphrases": [
620
+ "22nd"
621
+ ],
622
+ "paraphrasesParenthesized": [
623
+ "(22nd)"
624
+ ],
625
+ "query": "22nd",
626
+ "responses": [
627
+ ""
628
+ ]
629
+ },
630
+ {
631
+ "associations": [
632
+ ],
633
+ "config": {
634
+ },
635
+ "contexts": [
636
+ {
637
+ "dead": true,
638
+ "instance": true,
639
+ "level": 1,
640
+ "marker": "ordinal",
641
+ "ordinal": true,
642
+ "range": {
643
+ "end": 3,
644
+ "start": 0
645
+ },
646
+ "text": "21st",
647
+ "topLevel": true,
648
+ "value": 21,
649
+ "word": "21st"
650
+ }
651
+ ],
652
+ "developerTest": false,
653
+ "generatedParenthesized": [
654
+ ""
655
+ ],
656
+ "metadata": {
657
+ "opChoices": [
658
+ {
659
+ "counter": 1,
660
+ "op": [
661
+ "ordinal",
662
+ 0
663
+ ],
664
+ "ops": [
665
+ [
666
+ "ordinal",
667
+ 0
668
+ ]
669
+ ]
670
+ }
671
+ ]
672
+ },
673
+ "objects": {
674
+ "nameToUUID": {
675
+ "articles": "articles2",
676
+ "gdefaults": "gdefaults2",
677
+ "numbers": "numbers2",
678
+ "ordinals": "ordinals1",
679
+ "pos": "pos2",
680
+ "punctuation": "punctuation2",
681
+ "sdefaults": "sdefaults2",
682
+ "tokenize": "tokenize2"
683
+ },
684
+ "namespaced": {
685
+ "articles2": {
686
+ },
687
+ "gdefaults2": {
688
+ },
689
+ "numbers2": {
690
+ },
691
+ "ordinals1": {
692
+ },
693
+ "pos2": {
694
+ },
695
+ "punctuation2": {
696
+ },
697
+ "sdefaults2": {
698
+ },
699
+ "tokenize2": {
700
+ }
701
+ },
702
+ "processed": [
703
+ {
704
+ "context": {
705
+ "dead": true,
706
+ "instance": true,
707
+ "level": 1,
708
+ "marker": "ordinal",
709
+ "ordinal": true,
710
+ "range": {
711
+ "end": 3,
712
+ "start": 0
713
+ },
714
+ "text": "21st",
715
+ "topLevel": true,
716
+ "value": 21,
717
+ "word": "21st"
718
+ },
719
+ "generatedParenthesized": "",
720
+ "paraphrases": "21st",
721
+ "paraphrasesParenthesized": "(21st)",
722
+ "responses": [
723
+ ""
724
+ ]
725
+ }
726
+ ]
727
+ },
728
+ "paraphrases": [
729
+ "21st"
730
+ ],
731
+ "paraphrasesParenthesized": [
732
+ "(21st)"
733
+ ],
734
+ "query": "21st",
735
+ "responses": [
736
+ ""
737
+ ]
411
738
  }
412
739
  ]