tpmkms_4wp 8.9.1-beta.3 → 8.9.1-beta.31
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.
- package/common/animals.instance.json +6736 -831
- package/common/articles.js +22 -9
- package/common/articles.test.json +640 -2
- package/common/asking.js +3 -3
- package/common/asking.test.json +1599 -140
- package/common/avatar.js +9 -1
- package/common/avatar.test.json +6008 -2749
- package/common/characters.js +1 -1
- package/common/characters.test.json +1371 -95
- package/common/colors.instance.json +22825 -1424
- package/common/colors.test.json +704 -136
- package/common/comparable.instance.json +1337 -159
- package/common/comparable.js +13 -13
- package/common/comparable.test.json +3239 -558
- package/common/concept.js +11 -3
- package/common/concept.test.json +2853 -694
- package/common/conjunction.js +13 -1
- package/common/conjunction.test.json +229 -1
- package/common/countable.js +3 -9
- package/common/countable.test.json +1310 -638
- package/common/crew.instance.json +19486 -2159
- package/common/crew.js +19 -0
- package/common/crew.test.json +10218 -2145
- package/common/currency.js +2 -3
- package/common/currency.test.json +948 -64
- package/common/dialogues.js +102 -35
- package/common/dialogues.test.json +6611 -1905
- package/common/dimension.instance.json +760 -120
- package/common/dimension.js +18 -4
- package/common/dimension.test.json +23680 -11550
- package/common/edible.instance.json +21905 -2694
- package/common/edible.js +13 -0
- package/common/edible.test.json +1580 -304
- package/common/emotions.instance.json +2224 -253
- package/common/emotions.js +10 -2
- package/common/emotions.test.json +1134 -107
- package/common/errors.js +1 -1
- package/common/errors.test.json +88 -0
- package/common/evaluate.test.json +100 -1
- package/common/events.js +1 -1
- package/common/events.test.json +2197 -242
- package/common/fastfood.instance.json +82039 -9948
- package/common/fastfood.js +99 -12
- package/common/fastfood.test.json +65486 -21430
- package/common/formulas.instance.json +325 -58
- package/common/formulas.js +1 -1
- package/common/formulas.test.json +13202 -6757
- package/common/gdefaults.js +18 -8
- package/common/help.js +4 -4
- package/common/help.test.json +292 -4
- package/common/helpers/concept.js +6 -5
- package/common/helpers/conjunction.js +1 -1
- package/common/helpers/formulas.js +4 -4
- package/common/helpers/frankenhash.js +4 -4
- package/common/helpers/meta.js +4 -4
- package/common/helpers/ordering.js +2 -2
- package/common/helpers/properties.js +18 -48
- package/common/helpers.js +1 -1
- package/common/hierarchy.js +12 -3
- package/common/hierarchy.test.json +53813 -17340
- package/common/javascript.js +1 -1
- package/common/javascript.test.json +214 -11
- package/common/kirk.instance.json +322 -7
- package/common/kirk.test.json +1123 -254
- package/common/length.instance.json +9890 -797
- package/common/length.test.json +12055 -8184
- package/common/listener.test.json +39 -1
- package/common/math.instance.json +294 -57
- package/common/math.js +1 -1
- package/common/math.test.json +38557 -17754
- package/common/meta.instance.json +1 -0
- package/common/meta.js +13 -13
- package/common/meta.test.json +2770 -275
- package/common/nameable.js +1 -1
- package/common/nameable.test.json +5150 -1475
- package/common/negation.js +1 -1
- package/common/negation.test.json +146 -8
- package/common/numbers.js +1 -1
- package/common/numbers.test.json +234 -0
- package/common/ordering.instance.json +3861 -508
- package/common/ordering.test.json +2680 -1283
- package/common/ordinals.js +15 -3
- package/common/ordinals.test.json +627 -3
- package/common/people.instance.json +4028 -675
- package/common/people.js +1 -15
- package/common/people.test.json +27157 -13664
- package/common/percentages.js +1 -2
- package/common/percentages.test.json +313 -0
- package/common/pipboy.instance.json +13636 -1481
- package/common/pipboy.js +28 -48
- package/common/pipboy.test.json +17367 -5640
- package/common/pokemon.instance.json +6163 -690
- package/common/pokemon.test.json +1826 -389
- package/common/pos.js +16 -6
- package/common/pressure.instance.json +2635 -291
- package/common/pressure.test.json +2997 -1629
- package/common/properties.instance.json +907 -128
- package/common/properties.js +19 -28
- package/common/properties.test.json +46801 -14612
- package/common/punctuation.js +1 -1
- package/common/punctuation.test.json +327 -0
- package/common/reports.instance.json +997 -118
- package/common/reports.js +16 -9
- package/common/reports.test.json +16653 -2453
- package/common/scorekeeper.instance.json +1 -0
- package/common/scorekeeper.js +22 -12
- package/common/scorekeeper.test.json +42546 -15408
- package/common/sdefaults.js +2 -2
- package/common/sizeable.js +2 -2
- package/common/sizeable.test.json +1170 -215
- package/common/spock.instance.json +322 -7
- package/common/spock.test.json +1123 -254
- package/common/stgame.js +0 -1
- package/common/stgame.test.json +1371 -91
- package/common/stm.js +6 -6
- package/common/stm.test.json +842 -9
- package/common/tell.js +1 -1
- package/common/tell.test.json +224 -1
- package/common/temperature.instance.json +5980 -285
- package/common/temperature.test.json +2610 -1272
- package/common/tester.js +1 -1
- package/common/testing.test.json +84 -1
- package/common/time.test.json +5345 -272
- package/common/tokenize.js +3 -2
- package/common/tokenize.test.json +39 -0
- package/common/ui.instance.json +144 -26
- package/common/ui.js +0 -16
- package/common/ui.test.json +4620 -140
- package/common/weight.instance.json +9990 -788
- package/common/weight.js +10 -0
- package/common/weight.test.json +18658 -12176
- package/common/wp.instance.json +20102 -1965
- package/common/wp.js +197 -44
- package/common/wp.test.json +121113 -17800
- package/common/yesno.js +1 -1
- package/common/yesno.test.json +168 -4
- package/package.json +11 -6
package/common/gdefaults.js
CHANGED
@@ -5,7 +5,7 @@ const tokenize = require('./tokenize.js')
|
|
5
5
|
const gdefaults_tests = require('./gdefaults.test.json')
|
6
6
|
const { getValue, isMany } = require('./helpers.js')
|
7
7
|
|
8
|
-
|
8
|
+
const config = {
|
9
9
|
name: 'gdefaults',
|
10
10
|
generators: [
|
11
11
|
/* TODO save for later
|
@@ -34,18 +34,28 @@ let config = {
|
|
34
34
|
match: ({context}) => context.generate,
|
35
35
|
apply: async ({context, gs}) => {
|
36
36
|
const contexts = []
|
37
|
-
for (const
|
38
|
-
|
39
|
-
if (
|
37
|
+
for (const keyOrContext of (context.modifiers || []).concat(context.generate)) {
|
38
|
+
let value = keyOrContext
|
39
|
+
if (keyOrContext.invisible) {
|
40
40
|
continue
|
41
41
|
}
|
42
|
-
if (
|
42
|
+
if (typeof keyOrContext == 'string') {
|
43
|
+
value = getValue(keyOrContext, context)
|
44
|
+
}
|
45
|
+
if (!(value !== undefined || keyOrContext == 'this')) {
|
46
|
+
continue
|
47
|
+
}
|
48
|
+
if (value?.skipDefault) {
|
43
49
|
continue
|
44
50
|
}
|
45
|
-
if (
|
51
|
+
if (keyOrContext == 'this') {
|
46
52
|
contexts.push({...context, generate: null})
|
47
53
|
} else {
|
48
|
-
|
54
|
+
if (Array.isArray(value)) {
|
55
|
+
contexts.push(...value)
|
56
|
+
} else {
|
57
|
+
contexts.push(value)
|
58
|
+
}
|
49
59
|
}
|
50
60
|
}
|
51
61
|
return gs(contexts)
|
@@ -67,7 +77,7 @@ let config = {
|
|
67
77
|
const text = []
|
68
78
|
for (modifier of (context.modifiers || [])) {
|
69
79
|
if (Array.isArray(context[modifier])) {
|
70
|
-
for (
|
80
|
+
for (const m of context[modifier]) {
|
71
81
|
text.push(await g(m))
|
72
82
|
}
|
73
83
|
} else {
|
package/common/help.js
CHANGED
@@ -13,7 +13,7 @@ const getHelp = (config, indent=2) => {
|
|
13
13
|
help += `${indent}NAME: ${config.name}\n`
|
14
14
|
help += `${indent}DESCRIPTION: ${config.description}\n\n`
|
15
15
|
help += `${indent}SAMPLE SENTENCES\n\n`
|
16
|
-
for (
|
16
|
+
for (const test of config.tests) {
|
17
17
|
if (test.developerTest) {
|
18
18
|
continue
|
19
19
|
}
|
@@ -43,7 +43,7 @@ const config = {
|
|
43
43
|
level: 0,
|
44
44
|
generatorp: () => 'help',
|
45
45
|
generatorr: ({context, config}) => {
|
46
|
-
|
46
|
+
const kms = helpers.propertyToArray(context.kms).map( (value) => value.value )
|
47
47
|
const isAll = kms.length == 0
|
48
48
|
let help = '';
|
49
49
|
let separator = ''
|
@@ -89,10 +89,10 @@ const config = {
|
|
89
89
|
|
90
90
|
const initializer = ({ config, addWord, kms }) => {
|
91
91
|
const names = new Set()
|
92
|
-
for (
|
92
|
+
for (const name in kms) {
|
93
93
|
names.add(name);
|
94
94
|
}
|
95
|
-
for (
|
95
|
+
for (const name of names) {
|
96
96
|
addWord(name, {id: "km", initial: `{ value: '${name}', word: '${name}' }`})
|
97
97
|
}
|
98
98
|
}
|
package/common/help.test.json
CHANGED
@@ -52,6 +52,7 @@
|
|
52
52
|
},
|
53
53
|
"contexts": [
|
54
54
|
{
|
55
|
+
"context_index": 1,
|
55
56
|
"dead": true,
|
56
57
|
"default": true,
|
57
58
|
"isResponse": true,
|
@@ -287,6 +288,7 @@
|
|
287
288
|
"processed": [
|
288
289
|
{
|
289
290
|
"context": {
|
291
|
+
"context_index": 1,
|
290
292
|
"dead": true,
|
291
293
|
"default": true,
|
292
294
|
"isResponse": true,
|
@@ -368,6 +370,253 @@
|
|
368
370
|
"query": "help with help and dialogues",
|
369
371
|
"responses": [
|
370
372
|
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n"
|
373
|
+
],
|
374
|
+
"summaries": [
|
375
|
+
{
|
376
|
+
"length": 1,
|
377
|
+
"summaries": [
|
378
|
+
{
|
379
|
+
"counter": 1,
|
380
|
+
"operators": [
|
381
|
+
{
|
382
|
+
"marker": [
|
383
|
+
"help",
|
384
|
+
0
|
385
|
+
],
|
386
|
+
"range": {
|
387
|
+
"end": 3,
|
388
|
+
"start": 0
|
389
|
+
}
|
390
|
+
},
|
391
|
+
{
|
392
|
+
"marker": [
|
393
|
+
"withKM",
|
394
|
+
0
|
395
|
+
],
|
396
|
+
"range": {
|
397
|
+
"end": 8,
|
398
|
+
"start": 5
|
399
|
+
}
|
400
|
+
},
|
401
|
+
{
|
402
|
+
"marker": [
|
403
|
+
"km",
|
404
|
+
0
|
405
|
+
],
|
406
|
+
"range": {
|
407
|
+
"end": 13,
|
408
|
+
"start": 10
|
409
|
+
}
|
410
|
+
},
|
411
|
+
{
|
412
|
+
"marker": [
|
413
|
+
"list",
|
414
|
+
0
|
415
|
+
],
|
416
|
+
"range": {
|
417
|
+
"end": 17,
|
418
|
+
"start": 15
|
419
|
+
}
|
420
|
+
},
|
421
|
+
{
|
422
|
+
"marker": [
|
423
|
+
"km",
|
424
|
+
0
|
425
|
+
],
|
426
|
+
"range": {
|
427
|
+
"end": 27,
|
428
|
+
"start": 19
|
429
|
+
}
|
430
|
+
}
|
431
|
+
]
|
432
|
+
},
|
433
|
+
{
|
434
|
+
"counter": 2,
|
435
|
+
"operators": [
|
436
|
+
{
|
437
|
+
"marker": [
|
438
|
+
"help",
|
439
|
+
0
|
440
|
+
],
|
441
|
+
"range": {
|
442
|
+
"end": 3,
|
443
|
+
"start": 0
|
444
|
+
}
|
445
|
+
},
|
446
|
+
{
|
447
|
+
"marker": [
|
448
|
+
"withKM",
|
449
|
+
0
|
450
|
+
],
|
451
|
+
"range": {
|
452
|
+
"end": 8,
|
453
|
+
"start": 5
|
454
|
+
}
|
455
|
+
},
|
456
|
+
{
|
457
|
+
"marker": [
|
458
|
+
"km",
|
459
|
+
1
|
460
|
+
],
|
461
|
+
"range": {
|
462
|
+
"end": 13,
|
463
|
+
"start": 10
|
464
|
+
}
|
465
|
+
},
|
466
|
+
{
|
467
|
+
"marker": [
|
468
|
+
"list",
|
469
|
+
0
|
470
|
+
],
|
471
|
+
"range": {
|
472
|
+
"end": 17,
|
473
|
+
"start": 15
|
474
|
+
}
|
475
|
+
},
|
476
|
+
{
|
477
|
+
"marker": [
|
478
|
+
"km",
|
479
|
+
0
|
480
|
+
],
|
481
|
+
"range": {
|
482
|
+
"end": 27,
|
483
|
+
"start": 19
|
484
|
+
}
|
485
|
+
}
|
486
|
+
]
|
487
|
+
},
|
488
|
+
{
|
489
|
+
"counter": 3,
|
490
|
+
"operators": [
|
491
|
+
{
|
492
|
+
"marker": [
|
493
|
+
"help",
|
494
|
+
0
|
495
|
+
],
|
496
|
+
"range": {
|
497
|
+
"end": 3,
|
498
|
+
"start": 0
|
499
|
+
}
|
500
|
+
},
|
501
|
+
{
|
502
|
+
"marker": [
|
503
|
+
"withKM",
|
504
|
+
0
|
505
|
+
],
|
506
|
+
"range": {
|
507
|
+
"end": 8,
|
508
|
+
"start": 5
|
509
|
+
}
|
510
|
+
},
|
511
|
+
{
|
512
|
+
"marker": [
|
513
|
+
"km",
|
514
|
+
1
|
515
|
+
],
|
516
|
+
"range": {
|
517
|
+
"end": 13,
|
518
|
+
"start": 10
|
519
|
+
}
|
520
|
+
},
|
521
|
+
{
|
522
|
+
"marker": [
|
523
|
+
"list",
|
524
|
+
0
|
525
|
+
],
|
526
|
+
"range": {
|
527
|
+
"end": 17,
|
528
|
+
"start": 15
|
529
|
+
}
|
530
|
+
},
|
531
|
+
{
|
532
|
+
"marker": [
|
533
|
+
"km",
|
534
|
+
1
|
535
|
+
],
|
536
|
+
"range": {
|
537
|
+
"end": 27,
|
538
|
+
"start": 19
|
539
|
+
}
|
540
|
+
}
|
541
|
+
]
|
542
|
+
},
|
543
|
+
{
|
544
|
+
"counter": 4,
|
545
|
+
"operators": [
|
546
|
+
{
|
547
|
+
"marker": [
|
548
|
+
"help",
|
549
|
+
0
|
550
|
+
],
|
551
|
+
"range": {
|
552
|
+
"end": 3,
|
553
|
+
"start": 0
|
554
|
+
}
|
555
|
+
},
|
556
|
+
{
|
557
|
+
"marker": [
|
558
|
+
"withKM",
|
559
|
+
0
|
560
|
+
],
|
561
|
+
"range": {
|
562
|
+
"end": 8,
|
563
|
+
"start": 5
|
564
|
+
}
|
565
|
+
},
|
566
|
+
{
|
567
|
+
"marker": [
|
568
|
+
"list",
|
569
|
+
1
|
570
|
+
],
|
571
|
+
"range": {
|
572
|
+
"end": 27,
|
573
|
+
"start": 10
|
574
|
+
}
|
575
|
+
}
|
576
|
+
]
|
577
|
+
},
|
578
|
+
{
|
579
|
+
"counter": 5,
|
580
|
+
"operators": [
|
581
|
+
{
|
582
|
+
"marker": [
|
583
|
+
"help",
|
584
|
+
0
|
585
|
+
],
|
586
|
+
"range": {
|
587
|
+
"end": 3,
|
588
|
+
"start": 0
|
589
|
+
}
|
590
|
+
},
|
591
|
+
{
|
592
|
+
"marker": [
|
593
|
+
"withKM",
|
594
|
+
1
|
595
|
+
],
|
596
|
+
"range": {
|
597
|
+
"end": 27,
|
598
|
+
"start": 5
|
599
|
+
}
|
600
|
+
}
|
601
|
+
]
|
602
|
+
},
|
603
|
+
{
|
604
|
+
"counter": 6,
|
605
|
+
"operators": [
|
606
|
+
{
|
607
|
+
"marker": [
|
608
|
+
"help",
|
609
|
+
1
|
610
|
+
],
|
611
|
+
"range": {
|
612
|
+
"end": 27,
|
613
|
+
"start": 0
|
614
|
+
}
|
615
|
+
}
|
616
|
+
]
|
617
|
+
}
|
618
|
+
]
|
619
|
+
}
|
371
620
|
]
|
372
621
|
},
|
373
622
|
{
|
@@ -377,6 +626,7 @@
|
|
377
626
|
},
|
378
627
|
"contexts": [
|
379
628
|
{
|
629
|
+
"context_index": 1,
|
380
630
|
"dead": true,
|
381
631
|
"default": true,
|
382
632
|
"isResponse": true,
|
@@ -395,7 +645,7 @@
|
|
395
645
|
}
|
396
646
|
],
|
397
647
|
"generatedParenthesized": [
|
398
|
-
"( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)"
|
648
|
+
"( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n every distributable\n each distributable\n\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)"
|
399
649
|
],
|
400
650
|
"metadata": {
|
401
651
|
"opChoices": [
|
@@ -473,6 +723,7 @@
|
|
473
723
|
"processed": [
|
474
724
|
{
|
475
725
|
"context": {
|
726
|
+
"context_index": 1,
|
476
727
|
"dead": true,
|
477
728
|
"default": true,
|
478
729
|
"isResponse": true,
|
@@ -489,11 +740,11 @@
|
|
489
740
|
"value": "help",
|
490
741
|
"word": "help"
|
491
742
|
},
|
492
|
-
"generatedParenthesized": "( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)",
|
743
|
+
"generatedParenthesized": "( NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n every distributable\n each distributable\n\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n)",
|
493
744
|
"paraphrases": "help",
|
494
745
|
"paraphrasesParenthesized": "(help)",
|
495
746
|
"responses": [
|
496
|
-
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
|
747
|
+
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n every distributable\n each distributable\n\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
|
497
748
|
]
|
498
749
|
}
|
499
750
|
]
|
@@ -506,7 +757,44 @@
|
|
506
757
|
],
|
507
758
|
"query": "help",
|
508
759
|
"responses": [
|
509
|
-
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
|
760
|
+
" NAME: help\n DESCRIPTION: Help the user with the current knowledge modules\n\n SAMPLE SENTENCES\n\n help with help and dialogues\n help\n\n NAME: dialogues\n DESCRIPTION: framework for dialogues\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n be brief\n be brief greg\n is x y\n no\n what is it\n x is y?\n yes\n x is 3 what is x\n x is 3 what is x what is it\n be brief x is 3 what is x what is it\n to it\n why\n setidsuffix greg\n setidsuffix greg resetidsuffix\n setidsuffix greg makeObject banana\\nbanana\n setidsuffix _suffy\n\n NAME: asking\n DESCRIPTION: asking the user questions\n\n SAMPLE SENTENCES\n\n nevermindTestSetup accept nevermind hi\n nevermindTestSetup reject nevermind hi\n whichOnesTestSetup apple banana pear\\npear\n whichOnesTestSetup apple banana pear\\ngoat\n whichOnesTestSetup apple banana pear\\nnevermind\n whichOnesTestSetup apple banana pear\\napple and pear\n\n NAME: negation\n DESCRIPTION: negation\n\n SAMPLE SENTENCES\n\n not negatable\n not negatables\n\n NAME: stm\n DESCRIPTION: short term memory\n\n SAMPLE SENTENCES\n\n remember m1\n previous memorable\n m1\n remember m1\\nevaluate the memorable\n the memorable before\n remember m1\\nremember m2\\nevaluate the memorable before\n\n NAME: meta\n DESCRIPTION: Ways of defining new language elements\n\n SAMPLE SENTENCES\n\n a means b\n a means x\n if f then g gq\n undefined means defined\n\n NAME: conjunction\n DESCRIPTION: framework for conjunction\n\n SAMPLE SENTENCES\n\n 1 2 and 3\n\n NAME: evaluate\n DESCRIPTION: Explicit handling of evaluate\n\n SAMPLE SENTENCES\n\n evaluate value1\n\n NAME: articles\n DESCRIPTION: articles\n\n SAMPLE SENTENCES\n\n the theable\n a theable\n every distributable\n each distributable\n\n\n\n NAME: punctuation\n DESCRIPTION: punctuation\n\n SAMPLE SENTENCES\n\n (a)\n :\n \"hi man\"\n\n\n NAME: tokenize\n DESCRIPTION: tokenize\n\n SAMPLE SENTENCES\n\n hello_world\n"
|
761
|
+
],
|
762
|
+
"summaries": [
|
763
|
+
{
|
764
|
+
"length": 1,
|
765
|
+
"summaries": [
|
766
|
+
{
|
767
|
+
"counter": 1,
|
768
|
+
"operators": [
|
769
|
+
{
|
770
|
+
"marker": [
|
771
|
+
"help",
|
772
|
+
0
|
773
|
+
],
|
774
|
+
"range": {
|
775
|
+
"end": 3,
|
776
|
+
"start": 0
|
777
|
+
}
|
778
|
+
}
|
779
|
+
]
|
780
|
+
},
|
781
|
+
{
|
782
|
+
"counter": 2,
|
783
|
+
"operators": [
|
784
|
+
{
|
785
|
+
"marker": [
|
786
|
+
"help",
|
787
|
+
1
|
788
|
+
],
|
789
|
+
"range": {
|
790
|
+
"end": 3,
|
791
|
+
"start": 0
|
792
|
+
}
|
793
|
+
}
|
794
|
+
]
|
795
|
+
}
|
796
|
+
]
|
797
|
+
}
|
510
798
|
]
|
511
799
|
}
|
512
800
|
]
|
@@ -11,7 +11,7 @@ class API {
|
|
11
11
|
}
|
12
12
|
|
13
13
|
addDefaultTypesForObjectHierarchy(types) {
|
14
|
-
for (
|
14
|
+
for (const type of types) {
|
15
15
|
this._objects.defaultTypesForHierarchy.add(type)
|
16
16
|
}
|
17
17
|
}
|
@@ -23,7 +23,7 @@ class API {
|
|
23
23
|
types.push('concept');
|
24
24
|
}
|
25
25
|
|
26
|
-
for (
|
26
|
+
for (const type of types) {
|
27
27
|
config.addHierarchy(id, type)
|
28
28
|
}
|
29
29
|
}
|
@@ -65,6 +65,7 @@ class API {
|
|
65
65
|
config.addOperator({ pattern: `([${modifierId}|])`, allowDups: true })
|
66
66
|
}
|
67
67
|
config.addHierarchy(modifierId, objectModifierConcept)
|
68
|
+
config.addHierarchy(objectModifierConcept, 'adjective')
|
68
69
|
})
|
69
70
|
if (!config.exists(objectId)) {
|
70
71
|
config.addOperator({ pattern: `([${objectId}|])`, allowDups: true })
|
@@ -133,8 +134,8 @@ class API {
|
|
133
134
|
}
|
134
135
|
config.addHierarchy(modifiersObjectId, objectId)
|
135
136
|
|
136
|
-
modifierIds.forEach((modifierId) => config.addPriority({ "context": [[modifierId, 0], ['
|
137
|
-
config.addPriority({ "context": [[objectId, 0], ['
|
137
|
+
modifierIds.forEach((modifierId) => config.addPriority({ "context": [[modifierId, 0], ['article', 0]], "choose": [0] }))
|
138
|
+
config.addPriority({ "context": [[objectId, 0], ['article', 0], ], "choose": [0] })
|
138
139
|
// maybe remove the next line
|
139
140
|
modifierIds.forEach((modifierId) => config.addPriority({ context: [[modifiersObjectId, 0], [modifierId, 0], ], generalize: false, choose: [0] }))
|
140
141
|
config.addPriority({ "context": [[modifiersObjectId, 0], [objectId, 0], ], choose: [0] })
|
@@ -142,7 +143,7 @@ class API {
|
|
142
143
|
if (config.exists('number')) {
|
143
144
|
// config.addPriority({ context: [['list', 0], ['number', 0]].concat(modifierIds.map((id) => [id, 0])).concat([[objectId, 0]]), ordered: true, choose: [2,3] })
|
144
145
|
if (modifierIds.length > 1) {
|
145
|
-
|
146
|
+
const choose = []
|
146
147
|
for (let i = 0; i < modifierIds.length; ++i) {
|
147
148
|
choose.push(i+2)
|
148
149
|
}
|
@@ -43,7 +43,7 @@ const isA = (hierarchy) => (child, parent, { strict=false } = {}) => {
|
|
43
43
|
return hierarchy.isA(child, parent)
|
44
44
|
} else {
|
45
45
|
const children = propertyToArray(child)
|
46
|
-
for (
|
46
|
+
for (const child of children) {
|
47
47
|
let okay = false
|
48
48
|
if (hierarchy.isA(child.marker || child, parent.marker || parent)) {
|
49
49
|
okay = true
|
@@ -14,7 +14,7 @@ function getVariables(expression, isVariable = (expression) => typeof expression
|
|
14
14
|
}
|
15
15
|
|
16
16
|
const match = (values, head, value) => {
|
17
|
-
for (
|
17
|
+
for (const prop in head) {
|
18
18
|
if (head[prop] instanceof Function) {
|
19
19
|
if (!head[prop](value[prop])) {
|
20
20
|
return
|
@@ -25,7 +25,7 @@ const match = (values, head, value) => {
|
|
25
25
|
return
|
26
26
|
}
|
27
27
|
}
|
28
|
-
for (
|
28
|
+
for (const prop in values) {
|
29
29
|
if (!values[prop]) {
|
30
30
|
return
|
31
31
|
}
|
@@ -107,11 +107,11 @@ class API {
|
|
107
107
|
get(name, expectedVars) {
|
108
108
|
if (expectedVars) {
|
109
109
|
const fs = this.gets(name);
|
110
|
-
for (
|
110
|
+
for (const f of fs) {
|
111
111
|
const foundVars = getVariables(f.formula)
|
112
112
|
if (foundVars.length == expectedVars.length) {
|
113
113
|
let failed = false
|
114
|
-
for (
|
114
|
+
for (const ev of expectedVars) {
|
115
115
|
if (!foundVars.find( (fv) => fv.value == ev.value )) {
|
116
116
|
failed = true
|
117
117
|
break
|
@@ -14,7 +14,7 @@ class Frankenhash {
|
|
14
14
|
|
15
15
|
setHandler(path, handler) {
|
16
16
|
let where = this.data.handlers
|
17
|
-
for (
|
17
|
+
for (const arg of path.slice(0, path.length-1)) {
|
18
18
|
if (!where[arg]) {
|
19
19
|
where[arg] = {}
|
20
20
|
}
|
@@ -25,7 +25,7 @@ class Frankenhash {
|
|
25
25
|
|
26
26
|
getValue(path, writeDefault=true) {
|
27
27
|
let value = this.data.root
|
28
|
-
for (
|
28
|
+
for (const property of path) {
|
29
29
|
if (!value[property]) {
|
30
30
|
if (writeDefault) {
|
31
31
|
value[property] = {}
|
@@ -44,7 +44,7 @@ class Frankenhash {
|
|
44
44
|
|
45
45
|
getHandler(path) {
|
46
46
|
let value = this.data.handlers
|
47
|
-
for (
|
47
|
+
for (const property of path) {
|
48
48
|
if (this.isHandler(value)) {
|
49
49
|
return value
|
50
50
|
}
|
@@ -56,7 +56,7 @@ class Frankenhash {
|
|
56
56
|
|
57
57
|
knownProperty(path) {
|
58
58
|
let value = this.data.root;
|
59
|
-
for (
|
59
|
+
for (const property of path) {
|
60
60
|
if (!value[property]) {
|
61
61
|
return false
|
62
62
|
}
|
package/common/helpers/meta.js
CHANGED
@@ -2,7 +2,7 @@ const _ = require('lodash')
|
|
2
2
|
|
3
3
|
const hashIndexesGet = (hash, indexes) => {
|
4
4
|
let value = hash
|
5
|
-
for (
|
5
|
+
for (const i of indexes) {
|
6
6
|
value = value[i]
|
7
7
|
}
|
8
8
|
return value
|
@@ -10,7 +10,7 @@ const hashIndexesGet = (hash, indexes) => {
|
|
10
10
|
|
11
11
|
const hashIndexesSet = (hash, indexes, value) => {
|
12
12
|
let currentValue = hash
|
13
|
-
for (
|
13
|
+
for (const i of indexes.slice(0, -1)) {
|
14
14
|
if (!currentValue[i]) {
|
15
15
|
currentValue[i] = {}
|
16
16
|
}
|
@@ -53,7 +53,7 @@ const translationMapping = (from, to) => {
|
|
53
53
|
if (from.atomic) {
|
54
54
|
return mappings
|
55
55
|
}
|
56
|
-
for (
|
56
|
+
for (const fkey of Object.keys(from)) {
|
57
57
|
let matchField;
|
58
58
|
if (from[fkey].value) {
|
59
59
|
matchField = 'value'
|
@@ -75,7 +75,7 @@ const translationMapping = (from, to) => {
|
|
75
75
|
break
|
76
76
|
} else {
|
77
77
|
if (typeof tvalue !== 'string' && typeof tvalue !== 'number') {
|
78
|
-
for (
|
78
|
+
for (const key of Object.keys(tvalue)) {
|
79
79
|
todo.push(tkey.concat(key))
|
80
80
|
}
|
81
81
|
}
|
@@ -51,13 +51,13 @@ class API {
|
|
51
51
|
}
|
52
52
|
} else if (larger) {
|
53
53
|
const edges = []
|
54
|
-
for (
|
54
|
+
for (const smaller of digraph.descendants(larger)) {
|
55
55
|
edges.push({ smaller, context, larger, name })
|
56
56
|
}
|
57
57
|
return edges;
|
58
58
|
} else if (smaller) {
|
59
59
|
const edges = []
|
60
|
-
for (
|
60
|
+
for (const larger of digraph.ancestors(smaller)) {
|
61
61
|
edges.push({ smaller, context, larger, name })
|
62
62
|
}
|
63
63
|
return edges;
|