tpmkms_4wp 8.0.0-beta.34 → 8.0.0-beta.36
Sign up to get free protection for your applications and to get access to all the features.
- package/common/nameable.js +9 -7
- package/common/nameable.test.json +651 -43
- package/common/stm.js +7 -4
- package/common/stm.test.json +48 -16
- package/package.json +2 -2
package/common/nameable.js
CHANGED
@@ -12,10 +12,13 @@ class API {
|
|
12
12
|
|
13
13
|
// report is a context
|
14
14
|
setName(context, name) {
|
15
|
-
if (!context.
|
16
|
-
context.
|
15
|
+
if (!context.nameable) {
|
16
|
+
context.nameable = {}
|
17
17
|
}
|
18
|
-
context.
|
18
|
+
if (!context.nameable.names) {
|
19
|
+
context.nameable.names = []
|
20
|
+
}
|
21
|
+
context.nameable.names.push(name)
|
19
22
|
}
|
20
23
|
|
21
24
|
get(name) {
|
@@ -23,12 +26,11 @@ class API {
|
|
23
26
|
}
|
24
27
|
|
25
28
|
getNamesByType(type) {
|
26
|
-
debugger
|
27
29
|
const contexts = this.args.kms.stm.api.getByType(type)
|
28
30
|
const names = new Set()
|
29
31
|
for (const context of contexts) {
|
30
|
-
if (context.
|
31
|
-
for (const name of context.
|
32
|
+
if (context.nameable.names) {
|
33
|
+
for (const name of context.nameable.names) {
|
32
34
|
names.add(name)
|
33
35
|
}
|
34
36
|
}
|
@@ -94,7 +96,7 @@ const configStruct = {
|
|
94
96
|
// TODO find report being referred to
|
95
97
|
const nameable = (await e(context.nameable)).evalue
|
96
98
|
const name = context.name.text
|
97
|
-
config.addWord(name, { id: nameable.marker, initial: `{ value: "${nameable.marker}", nameable_named: true }` })
|
99
|
+
config.addWord(name, { id: nameable.marker, initial: `{ value: "${nameable.marker}", pullFromContext: true, nameable_named: true }` })
|
98
100
|
api.setName(nameable, name)
|
99
101
|
}
|
100
102
|
},
|
@@ -93,15 +93,19 @@
|
|
93
93
|
"fromSTM": true,
|
94
94
|
"level": 1,
|
95
95
|
"marker": "m1",
|
96
|
-
"
|
97
|
-
"
|
98
|
-
|
96
|
+
"nameable": {
|
97
|
+
"names": [
|
98
|
+
"banana"
|
99
|
+
]
|
100
|
+
},
|
99
101
|
"pullFromContext": false,
|
100
102
|
"range": {
|
101
103
|
"end": 10,
|
102
104
|
"start": 9
|
103
105
|
},
|
104
|
-
"
|
106
|
+
"stm": {
|
107
|
+
"id": 1
|
108
|
+
},
|
105
109
|
"text": "m1",
|
106
110
|
"types": [
|
107
111
|
"m1"
|
@@ -172,7 +176,6 @@
|
|
172
176
|
"word": "call"
|
173
177
|
}
|
174
178
|
],
|
175
|
-
"developerTest": true,
|
176
179
|
"generatedParenthesized": [
|
177
180
|
"",
|
178
181
|
""
|
@@ -350,15 +353,19 @@
|
|
350
353
|
"fromSTM": true,
|
351
354
|
"level": 1,
|
352
355
|
"marker": "m1",
|
353
|
-
"
|
354
|
-
"
|
355
|
-
|
356
|
+
"nameable": {
|
357
|
+
"names": [
|
358
|
+
"banana"
|
359
|
+
]
|
360
|
+
},
|
356
361
|
"pullFromContext": false,
|
357
362
|
"range": {
|
358
363
|
"end": 10,
|
359
364
|
"start": 9
|
360
365
|
},
|
361
|
-
"
|
366
|
+
"stm": {
|
367
|
+
"id": 1
|
368
|
+
},
|
362
369
|
"text": "m1",
|
363
370
|
"types": [
|
364
371
|
"m1"
|
@@ -456,15 +463,19 @@
|
|
456
463
|
"fromSTM": true,
|
457
464
|
"level": 1,
|
458
465
|
"marker": "m1",
|
459
|
-
"
|
460
|
-
"
|
461
|
-
|
466
|
+
"nameable": {
|
467
|
+
"names": [
|
468
|
+
"banana"
|
469
|
+
]
|
470
|
+
},
|
462
471
|
"pullFromContext": false,
|
463
472
|
"range": {
|
464
473
|
"end": 10,
|
465
474
|
"start": 9
|
466
475
|
},
|
467
|
-
"
|
476
|
+
"stm": {
|
477
|
+
"id": 1
|
478
|
+
},
|
468
479
|
"text": "m1",
|
469
480
|
"types": [
|
470
481
|
"m1"
|
@@ -538,15 +549,19 @@
|
|
538
549
|
"fromSTM": true,
|
539
550
|
"level": 1,
|
540
551
|
"marker": "m1",
|
541
|
-
"
|
542
|
-
"
|
543
|
-
|
552
|
+
"nameable": {
|
553
|
+
"names": [
|
554
|
+
"banana"
|
555
|
+
]
|
556
|
+
},
|
544
557
|
"pullFromContext": false,
|
545
558
|
"range": {
|
546
559
|
"end": 10,
|
547
560
|
"start": 9
|
548
561
|
},
|
549
|
-
"
|
562
|
+
"stm": {
|
563
|
+
"id": 1
|
564
|
+
},
|
550
565
|
"text": "m1",
|
551
566
|
"types": [
|
552
567
|
"m1"
|
@@ -629,7 +644,32 @@
|
|
629
644
|
"end": 14,
|
630
645
|
"start": 0
|
631
646
|
},
|
632
|
-
"response":
|
647
|
+
"response": {
|
648
|
+
"dead": true,
|
649
|
+
"default": true,
|
650
|
+
"fromSTM": true,
|
651
|
+
"level": 1,
|
652
|
+
"marker": "m1",
|
653
|
+
"nameable": {
|
654
|
+
"names": [
|
655
|
+
"banana"
|
656
|
+
]
|
657
|
+
},
|
658
|
+
"pullFromContext": false,
|
659
|
+
"range": {
|
660
|
+
"end": 10,
|
661
|
+
"start": 9
|
662
|
+
},
|
663
|
+
"stm": {
|
664
|
+
"id": 1
|
665
|
+
},
|
666
|
+
"text": "m1",
|
667
|
+
"types": [
|
668
|
+
"m1"
|
669
|
+
],
|
670
|
+
"value": "m1",
|
671
|
+
"word": "m1"
|
672
|
+
},
|
633
673
|
"text": "evaluate banana",
|
634
674
|
"topLevel": true,
|
635
675
|
"touchedBy": [
|
@@ -640,6 +680,7 @@
|
|
640
680
|
"level": 1,
|
641
681
|
"marker": "m1",
|
642
682
|
"nameable_named": true,
|
683
|
+
"pullFromContext": true,
|
643
684
|
"range": {
|
644
685
|
"end": 14,
|
645
686
|
"start": 9
|
@@ -651,11 +692,10 @@
|
|
651
692
|
"word": "evaluate"
|
652
693
|
}
|
653
694
|
],
|
654
|
-
"developerTest": true,
|
655
695
|
"generatedParenthesized": [
|
656
696
|
"",
|
657
697
|
"",
|
658
|
-
"(m1)"
|
698
|
+
"((m1))"
|
659
699
|
],
|
660
700
|
"metadata": {
|
661
701
|
"opChoices": [
|
@@ -828,15 +868,19 @@
|
|
828
868
|
"fromSTM": true,
|
829
869
|
"level": 1,
|
830
870
|
"marker": "m1",
|
831
|
-
"
|
832
|
-
"
|
833
|
-
|
871
|
+
"nameable": {
|
872
|
+
"names": [
|
873
|
+
"banana"
|
874
|
+
]
|
875
|
+
},
|
834
876
|
"pullFromContext": false,
|
835
877
|
"range": {
|
836
878
|
"end": 10,
|
837
879
|
"start": 9
|
838
880
|
},
|
839
|
-
"
|
881
|
+
"stm": {
|
882
|
+
"id": 1
|
883
|
+
},
|
840
884
|
"text": "m1",
|
841
885
|
"types": [
|
842
886
|
"m1"
|
@@ -866,7 +910,32 @@
|
|
866
910
|
"end": 14,
|
867
911
|
"start": 0
|
868
912
|
},
|
869
|
-
"response":
|
913
|
+
"response": {
|
914
|
+
"dead": true,
|
915
|
+
"default": true,
|
916
|
+
"fromSTM": true,
|
917
|
+
"level": 1,
|
918
|
+
"marker": "m1",
|
919
|
+
"nameable": {
|
920
|
+
"names": [
|
921
|
+
"banana"
|
922
|
+
]
|
923
|
+
},
|
924
|
+
"pullFromContext": false,
|
925
|
+
"range": {
|
926
|
+
"end": 10,
|
927
|
+
"start": 9
|
928
|
+
},
|
929
|
+
"stm": {
|
930
|
+
"id": 1
|
931
|
+
},
|
932
|
+
"text": "m1",
|
933
|
+
"types": [
|
934
|
+
"m1"
|
935
|
+
],
|
936
|
+
"value": "m1",
|
937
|
+
"word": "m1"
|
938
|
+
},
|
870
939
|
"text": "evaluate banana",
|
871
940
|
"topLevel": true,
|
872
941
|
"touchedBy": [
|
@@ -877,6 +946,7 @@
|
|
877
946
|
"level": 1,
|
878
947
|
"marker": "m1",
|
879
948
|
"nameable_named": true,
|
949
|
+
"pullFromContext": true,
|
880
950
|
"range": {
|
881
951
|
"end": 14,
|
882
952
|
"start": 9
|
@@ -887,7 +957,7 @@
|
|
887
957
|
},
|
888
958
|
"word": "evaluate"
|
889
959
|
},
|
890
|
-
"generatedParenthesized": "(m1)",
|
960
|
+
"generatedParenthesized": "((m1))",
|
891
961
|
"paraphrases": "evaluate banana",
|
892
962
|
"paraphrasesParenthesized": "((evaluate) (banana))",
|
893
963
|
"responses": [
|
@@ -975,15 +1045,19 @@
|
|
975
1045
|
"fromSTM": true,
|
976
1046
|
"level": 1,
|
977
1047
|
"marker": "m1",
|
978
|
-
"
|
979
|
-
"
|
980
|
-
|
1048
|
+
"nameable": {
|
1049
|
+
"names": [
|
1050
|
+
"banana"
|
1051
|
+
]
|
1052
|
+
},
|
981
1053
|
"pullFromContext": false,
|
982
1054
|
"range": {
|
983
1055
|
"end": 10,
|
984
1056
|
"start": 9
|
985
1057
|
},
|
986
|
-
"
|
1058
|
+
"stm": {
|
1059
|
+
"id": 1
|
1060
|
+
},
|
987
1061
|
"text": "m1",
|
988
1062
|
"types": [
|
989
1063
|
"m1"
|
@@ -1059,15 +1133,19 @@
|
|
1059
1133
|
"fromSTM": true,
|
1060
1134
|
"level": 1,
|
1061
1135
|
"marker": "m1",
|
1062
|
-
"
|
1063
|
-
"
|
1064
|
-
|
1136
|
+
"nameable": {
|
1137
|
+
"names": [
|
1138
|
+
"banana"
|
1139
|
+
]
|
1140
|
+
},
|
1065
1141
|
"pullFromContext": false,
|
1066
1142
|
"range": {
|
1067
1143
|
"end": 10,
|
1068
1144
|
"start": 9
|
1069
1145
|
},
|
1070
|
-
"
|
1146
|
+
"stm": {
|
1147
|
+
"id": 1
|
1148
|
+
},
|
1071
1149
|
"text": "m1",
|
1072
1150
|
"types": [
|
1073
1151
|
"m1"
|
@@ -1170,7 +1248,6 @@
|
|
1170
1248
|
"word": "getnamesbytype"
|
1171
1249
|
}
|
1172
1250
|
],
|
1173
|
-
"developerTest": false,
|
1174
1251
|
"generatedParenthesized": [
|
1175
1252
|
"",
|
1176
1253
|
"",
|
@@ -1347,15 +1424,19 @@
|
|
1347
1424
|
"fromSTM": true,
|
1348
1425
|
"level": 1,
|
1349
1426
|
"marker": "m1",
|
1350
|
-
"
|
1351
|
-
"
|
1352
|
-
|
1427
|
+
"nameable": {
|
1428
|
+
"names": [
|
1429
|
+
"banana"
|
1430
|
+
]
|
1431
|
+
},
|
1353
1432
|
"pullFromContext": false,
|
1354
1433
|
"range": {
|
1355
1434
|
"end": 10,
|
1356
1435
|
"start": 9
|
1357
1436
|
},
|
1358
|
-
"
|
1437
|
+
"stm": {
|
1438
|
+
"id": 1
|
1439
|
+
},
|
1359
1440
|
"text": "m1",
|
1360
1441
|
"types": [
|
1361
1442
|
"m1"
|
@@ -1492,15 +1573,19 @@
|
|
1492
1573
|
"fromSTM": true,
|
1493
1574
|
"level": 1,
|
1494
1575
|
"marker": "m1",
|
1495
|
-
"
|
1496
|
-
"
|
1497
|
-
|
1576
|
+
"nameable": {
|
1577
|
+
"names": [
|
1578
|
+
"banana"
|
1579
|
+
]
|
1580
|
+
},
|
1498
1581
|
"pullFromContext": false,
|
1499
1582
|
"range": {
|
1500
1583
|
"end": 10,
|
1501
1584
|
"start": 9
|
1502
1585
|
},
|
1503
|
-
"
|
1586
|
+
"stm": {
|
1587
|
+
"id": 1
|
1588
|
+
},
|
1504
1589
|
"text": "m1",
|
1505
1590
|
"types": [
|
1506
1591
|
"m1"
|
@@ -1541,5 +1626,528 @@
|
|
1541
1626
|
"",
|
1542
1627
|
"banana"
|
1543
1628
|
]
|
1629
|
+
},
|
1630
|
+
{
|
1631
|
+
"associations": [
|
1632
|
+
],
|
1633
|
+
"config": {
|
1634
|
+
},
|
1635
|
+
"contexts": [
|
1636
|
+
{
|
1637
|
+
"dead": true,
|
1638
|
+
"default": true,
|
1639
|
+
"level": 1,
|
1640
|
+
"marker": "remember",
|
1641
|
+
"postModifiers": [
|
1642
|
+
"rememberee"
|
1643
|
+
],
|
1644
|
+
"range": {
|
1645
|
+
"end": 10,
|
1646
|
+
"start": 0
|
1647
|
+
},
|
1648
|
+
"rememberee": {
|
1649
|
+
"dead": true,
|
1650
|
+
"default": true,
|
1651
|
+
"fromSTM": true,
|
1652
|
+
"level": 1,
|
1653
|
+
"marker": "m1",
|
1654
|
+
"nameable": {
|
1655
|
+
"names": [
|
1656
|
+
"banana"
|
1657
|
+
]
|
1658
|
+
},
|
1659
|
+
"pullFromContext": false,
|
1660
|
+
"range": {
|
1661
|
+
"end": 10,
|
1662
|
+
"start": 9
|
1663
|
+
},
|
1664
|
+
"stm": {
|
1665
|
+
"id": 1
|
1666
|
+
},
|
1667
|
+
"text": "m1",
|
1668
|
+
"types": [
|
1669
|
+
"m1"
|
1670
|
+
],
|
1671
|
+
"value": "m1",
|
1672
|
+
"word": "m1"
|
1673
|
+
},
|
1674
|
+
"text": "remember m1",
|
1675
|
+
"topLevel": true,
|
1676
|
+
"touchedBy": [
|
1677
|
+
"nameable#call2"
|
1678
|
+
],
|
1679
|
+
"value": "remember",
|
1680
|
+
"word": "remember"
|
1681
|
+
},
|
1682
|
+
{
|
1683
|
+
"dead": true,
|
1684
|
+
"default": true,
|
1685
|
+
"level": 1,
|
1686
|
+
"marker": "call",
|
1687
|
+
"name": {
|
1688
|
+
"dead": true,
|
1689
|
+
"level": 1,
|
1690
|
+
"marker": "unknown",
|
1691
|
+
"range": {
|
1692
|
+
"end": 17,
|
1693
|
+
"start": 12
|
1694
|
+
},
|
1695
|
+
"text": "banana",
|
1696
|
+
"unknown": true,
|
1697
|
+
"value": "banana",
|
1698
|
+
"word": "banana"
|
1699
|
+
},
|
1700
|
+
"nameable": {
|
1701
|
+
"concept": true,
|
1702
|
+
"dead": true,
|
1703
|
+
"default": true,
|
1704
|
+
"determiner": "the",
|
1705
|
+
"focusableForPhrase": true,
|
1706
|
+
"level": 1,
|
1707
|
+
"marker": "m1",
|
1708
|
+
"modifiers": [
|
1709
|
+
"determiner"
|
1710
|
+
],
|
1711
|
+
"pullFromContext": true,
|
1712
|
+
"range": {
|
1713
|
+
"end": 10,
|
1714
|
+
"start": 5
|
1715
|
+
},
|
1716
|
+
"text": "the m1",
|
1717
|
+
"types": [
|
1718
|
+
"m1"
|
1719
|
+
],
|
1720
|
+
"value": "m1",
|
1721
|
+
"wantsValue": true,
|
1722
|
+
"word": "m1"
|
1723
|
+
},
|
1724
|
+
"range": {
|
1725
|
+
"end": 17,
|
1726
|
+
"start": 0
|
1727
|
+
},
|
1728
|
+
"text": "call the m1 banana",
|
1729
|
+
"topLevel": true,
|
1730
|
+
"touchedBy": [
|
1731
|
+
"nameable#call2"
|
1732
|
+
],
|
1733
|
+
"value": "call",
|
1734
|
+
"word": "call"
|
1735
|
+
},
|
1736
|
+
{
|
1737
|
+
"dead": true,
|
1738
|
+
"level": 1,
|
1739
|
+
"marker": "m1",
|
1740
|
+
"nameable_named": true,
|
1741
|
+
"pullFromContext": true,
|
1742
|
+
"range": {
|
1743
|
+
"end": 5,
|
1744
|
+
"start": 0
|
1745
|
+
},
|
1746
|
+
"text": "banana",
|
1747
|
+
"topLevel": true,
|
1748
|
+
"touchedBy": [
|
1749
|
+
"nameable#call2"
|
1750
|
+
],
|
1751
|
+
"value": {
|
1752
|
+
"dead": true,
|
1753
|
+
"default": true,
|
1754
|
+
"fromSTM": true,
|
1755
|
+
"level": 1,
|
1756
|
+
"marker": "m1",
|
1757
|
+
"nameable": {
|
1758
|
+
"names": [
|
1759
|
+
"banana"
|
1760
|
+
]
|
1761
|
+
},
|
1762
|
+
"pullFromContext": false,
|
1763
|
+
"range": {
|
1764
|
+
"end": 10,
|
1765
|
+
"start": 9
|
1766
|
+
},
|
1767
|
+
"stm": {
|
1768
|
+
"id": 1
|
1769
|
+
},
|
1770
|
+
"text": "m1",
|
1771
|
+
"types": [
|
1772
|
+
"m1"
|
1773
|
+
],
|
1774
|
+
"value": "m1",
|
1775
|
+
"word": "m1"
|
1776
|
+
},
|
1777
|
+
"word": "banana"
|
1778
|
+
}
|
1779
|
+
],
|
1780
|
+
"generatedParenthesized": [
|
1781
|
+
"",
|
1782
|
+
"",
|
1783
|
+
""
|
1784
|
+
],
|
1785
|
+
"metadata": {
|
1786
|
+
"opChoices": [
|
1787
|
+
{
|
1788
|
+
"counter": 1,
|
1789
|
+
"op": [
|
1790
|
+
"m1",
|
1791
|
+
0
|
1792
|
+
],
|
1793
|
+
"ops": [
|
1794
|
+
[
|
1795
|
+
"m1",
|
1796
|
+
0
|
1797
|
+
],
|
1798
|
+
[
|
1799
|
+
"remember",
|
1800
|
+
0
|
1801
|
+
]
|
1802
|
+
]
|
1803
|
+
},
|
1804
|
+
{
|
1805
|
+
"counter": 2,
|
1806
|
+
"op": [
|
1807
|
+
"remember",
|
1808
|
+
0
|
1809
|
+
],
|
1810
|
+
"ops": [
|
1811
|
+
[
|
1812
|
+
"remember",
|
1813
|
+
0
|
1814
|
+
]
|
1815
|
+
]
|
1816
|
+
},
|
1817
|
+
{
|
1818
|
+
"counter": 1,
|
1819
|
+
"op": [
|
1820
|
+
"unknown",
|
1821
|
+
0
|
1822
|
+
],
|
1823
|
+
"ops": [
|
1824
|
+
[
|
1825
|
+
"call",
|
1826
|
+
0
|
1827
|
+
],
|
1828
|
+
[
|
1829
|
+
"m1",
|
1830
|
+
0
|
1831
|
+
],
|
1832
|
+
[
|
1833
|
+
"the",
|
1834
|
+
0
|
1835
|
+
],
|
1836
|
+
[
|
1837
|
+
"unknown",
|
1838
|
+
0
|
1839
|
+
]
|
1840
|
+
]
|
1841
|
+
},
|
1842
|
+
{
|
1843
|
+
"counter": 2,
|
1844
|
+
"op": [
|
1845
|
+
"m1",
|
1846
|
+
0
|
1847
|
+
],
|
1848
|
+
"ops": [
|
1849
|
+
[
|
1850
|
+
"call",
|
1851
|
+
0
|
1852
|
+
],
|
1853
|
+
[
|
1854
|
+
"m1",
|
1855
|
+
0
|
1856
|
+
],
|
1857
|
+
[
|
1858
|
+
"the",
|
1859
|
+
0
|
1860
|
+
]
|
1861
|
+
]
|
1862
|
+
},
|
1863
|
+
{
|
1864
|
+
"counter": 3,
|
1865
|
+
"op": [
|
1866
|
+
"the",
|
1867
|
+
0
|
1868
|
+
],
|
1869
|
+
"ops": [
|
1870
|
+
[
|
1871
|
+
"call",
|
1872
|
+
0
|
1873
|
+
],
|
1874
|
+
[
|
1875
|
+
"the",
|
1876
|
+
0
|
1877
|
+
]
|
1878
|
+
]
|
1879
|
+
},
|
1880
|
+
{
|
1881
|
+
"counter": 4,
|
1882
|
+
"op": [
|
1883
|
+
"call",
|
1884
|
+
0
|
1885
|
+
],
|
1886
|
+
"ops": [
|
1887
|
+
[
|
1888
|
+
"call",
|
1889
|
+
0
|
1890
|
+
]
|
1891
|
+
]
|
1892
|
+
},
|
1893
|
+
{
|
1894
|
+
"counter": 1,
|
1895
|
+
"op": [
|
1896
|
+
"m1",
|
1897
|
+
0
|
1898
|
+
],
|
1899
|
+
"ops": [
|
1900
|
+
[
|
1901
|
+
"m1",
|
1902
|
+
0
|
1903
|
+
]
|
1904
|
+
]
|
1905
|
+
}
|
1906
|
+
]
|
1907
|
+
},
|
1908
|
+
"objects": {
|
1909
|
+
"nameToUUID": {
|
1910
|
+
"articles": "articles2",
|
1911
|
+
"evaluate": "evaluate2",
|
1912
|
+
"gdefaults": "gdefaults2",
|
1913
|
+
"nameable": "nameable1",
|
1914
|
+
"pos": "pos2",
|
1915
|
+
"stm": "stm2",
|
1916
|
+
"tokenize": "tokenize2"
|
1917
|
+
},
|
1918
|
+
"namespaced": {
|
1919
|
+
"articles2": {
|
1920
|
+
},
|
1921
|
+
"evaluate2": {
|
1922
|
+
},
|
1923
|
+
"gdefaults2": {
|
1924
|
+
},
|
1925
|
+
"nameable1": {
|
1926
|
+
"named": {
|
1927
|
+
}
|
1928
|
+
},
|
1929
|
+
"pos2": {
|
1930
|
+
},
|
1931
|
+
"stm2": {
|
1932
|
+
"mentioned": [
|
1933
|
+
{
|
1934
|
+
"dead": true,
|
1935
|
+
"default": true,
|
1936
|
+
"fromSTM": true,
|
1937
|
+
"level": 1,
|
1938
|
+
"marker": "m1",
|
1939
|
+
"nameable": {
|
1940
|
+
"names": [
|
1941
|
+
"banana"
|
1942
|
+
]
|
1943
|
+
},
|
1944
|
+
"pullFromContext": false,
|
1945
|
+
"range": {
|
1946
|
+
"end": 10,
|
1947
|
+
"start": 9
|
1948
|
+
},
|
1949
|
+
"stm": {
|
1950
|
+
"id": 1
|
1951
|
+
},
|
1952
|
+
"text": "m1",
|
1953
|
+
"types": [
|
1954
|
+
"m1"
|
1955
|
+
],
|
1956
|
+
"value": "m1",
|
1957
|
+
"word": "m1"
|
1958
|
+
}
|
1959
|
+
],
|
1960
|
+
"variables": {
|
1961
|
+
}
|
1962
|
+
},
|
1963
|
+
"tokenize2": {
|
1964
|
+
}
|
1965
|
+
},
|
1966
|
+
"processed": [
|
1967
|
+
{
|
1968
|
+
"context": {
|
1969
|
+
"dead": true,
|
1970
|
+
"level": 1,
|
1971
|
+
"marker": "m1",
|
1972
|
+
"nameable_named": true,
|
1973
|
+
"pullFromContext": true,
|
1974
|
+
"range": {
|
1975
|
+
"end": 5,
|
1976
|
+
"start": 0
|
1977
|
+
},
|
1978
|
+
"text": "banana",
|
1979
|
+
"topLevel": true,
|
1980
|
+
"touchedBy": [
|
1981
|
+
"nameable#call2"
|
1982
|
+
],
|
1983
|
+
"value": {
|
1984
|
+
"dead": true,
|
1985
|
+
"default": true,
|
1986
|
+
"fromSTM": true,
|
1987
|
+
"level": 1,
|
1988
|
+
"marker": "m1",
|
1989
|
+
"nameable": {
|
1990
|
+
"names": [
|
1991
|
+
"banana"
|
1992
|
+
]
|
1993
|
+
},
|
1994
|
+
"pullFromContext": false,
|
1995
|
+
"range": {
|
1996
|
+
"end": 10,
|
1997
|
+
"start": 9
|
1998
|
+
},
|
1999
|
+
"stm": {
|
2000
|
+
"id": 1
|
2001
|
+
},
|
2002
|
+
"text": "m1",
|
2003
|
+
"types": [
|
2004
|
+
"m1"
|
2005
|
+
],
|
2006
|
+
"value": "m1",
|
2007
|
+
"word": "m1"
|
2008
|
+
},
|
2009
|
+
"word": "banana"
|
2010
|
+
},
|
2011
|
+
"generatedParenthesized": "",
|
2012
|
+
"paraphrases": "banana",
|
2013
|
+
"paraphrasesParenthesized": "(banana)",
|
2014
|
+
"responses": [
|
2015
|
+
""
|
2016
|
+
]
|
2017
|
+
},
|
2018
|
+
{
|
2019
|
+
"context": {
|
2020
|
+
"dead": true,
|
2021
|
+
"default": true,
|
2022
|
+
"level": 1,
|
2023
|
+
"marker": "call",
|
2024
|
+
"name": {
|
2025
|
+
"dead": true,
|
2026
|
+
"level": 1,
|
2027
|
+
"marker": "unknown",
|
2028
|
+
"range": {
|
2029
|
+
"end": 17,
|
2030
|
+
"start": 12
|
2031
|
+
},
|
2032
|
+
"text": "banana",
|
2033
|
+
"unknown": true,
|
2034
|
+
"value": "banana",
|
2035
|
+
"word": "banana"
|
2036
|
+
},
|
2037
|
+
"nameable": {
|
2038
|
+
"concept": true,
|
2039
|
+
"dead": true,
|
2040
|
+
"default": true,
|
2041
|
+
"determiner": "the",
|
2042
|
+
"focusableForPhrase": true,
|
2043
|
+
"level": 1,
|
2044
|
+
"marker": "m1",
|
2045
|
+
"modifiers": [
|
2046
|
+
"determiner"
|
2047
|
+
],
|
2048
|
+
"pullFromContext": true,
|
2049
|
+
"range": {
|
2050
|
+
"end": 10,
|
2051
|
+
"start": 5
|
2052
|
+
},
|
2053
|
+
"text": "the m1",
|
2054
|
+
"types": [
|
2055
|
+
"m1"
|
2056
|
+
],
|
2057
|
+
"value": "m1",
|
2058
|
+
"wantsValue": true,
|
2059
|
+
"word": "m1"
|
2060
|
+
},
|
2061
|
+
"range": {
|
2062
|
+
"end": 17,
|
2063
|
+
"start": 0
|
2064
|
+
},
|
2065
|
+
"text": "call the m1 banana",
|
2066
|
+
"topLevel": true,
|
2067
|
+
"touchedBy": [
|
2068
|
+
"nameable#call2"
|
2069
|
+
],
|
2070
|
+
"value": "call",
|
2071
|
+
"word": "call"
|
2072
|
+
},
|
2073
|
+
"generatedParenthesized": "",
|
2074
|
+
"paraphrases": "call the m1 banana",
|
2075
|
+
"paraphrasesParenthesized": "(call (the (m1)) (banana))",
|
2076
|
+
"responses": [
|
2077
|
+
""
|
2078
|
+
]
|
2079
|
+
},
|
2080
|
+
{
|
2081
|
+
"context": {
|
2082
|
+
"dead": true,
|
2083
|
+
"default": true,
|
2084
|
+
"level": 1,
|
2085
|
+
"marker": "remember",
|
2086
|
+
"postModifiers": [
|
2087
|
+
"rememberee"
|
2088
|
+
],
|
2089
|
+
"range": {
|
2090
|
+
"end": 10,
|
2091
|
+
"start": 0
|
2092
|
+
},
|
2093
|
+
"rememberee": {
|
2094
|
+
"dead": true,
|
2095
|
+
"default": true,
|
2096
|
+
"fromSTM": true,
|
2097
|
+
"level": 1,
|
2098
|
+
"marker": "m1",
|
2099
|
+
"nameable": {
|
2100
|
+
"names": [
|
2101
|
+
"banana"
|
2102
|
+
]
|
2103
|
+
},
|
2104
|
+
"pullFromContext": false,
|
2105
|
+
"range": {
|
2106
|
+
"end": 10,
|
2107
|
+
"start": 9
|
2108
|
+
},
|
2109
|
+
"stm": {
|
2110
|
+
"id": 1
|
2111
|
+
},
|
2112
|
+
"text": "m1",
|
2113
|
+
"types": [
|
2114
|
+
"m1"
|
2115
|
+
],
|
2116
|
+
"value": "m1",
|
2117
|
+
"word": "m1"
|
2118
|
+
},
|
2119
|
+
"text": "remember m1",
|
2120
|
+
"topLevel": true,
|
2121
|
+
"touchedBy": [
|
2122
|
+
"nameable#call2"
|
2123
|
+
],
|
2124
|
+
"value": "remember",
|
2125
|
+
"word": "remember"
|
2126
|
+
},
|
2127
|
+
"generatedParenthesized": "",
|
2128
|
+
"paraphrases": "remember m1",
|
2129
|
+
"paraphrasesParenthesized": "((remember) (m1))",
|
2130
|
+
"responses": [
|
2131
|
+
""
|
2132
|
+
]
|
2133
|
+
}
|
2134
|
+
]
|
2135
|
+
},
|
2136
|
+
"paraphrases": [
|
2137
|
+
"remember m1",
|
2138
|
+
"call the m1 banana",
|
2139
|
+
"banana"
|
2140
|
+
],
|
2141
|
+
"paraphrasesParenthesized": [
|
2142
|
+
"((remember) (m1))",
|
2143
|
+
"(call (the (m1)) (banana))",
|
2144
|
+
"(banana)"
|
2145
|
+
],
|
2146
|
+
"query": "remember m1\\ncall the m1 banana\\nbanana",
|
2147
|
+
"responses": [
|
2148
|
+
"",
|
2149
|
+
"",
|
2150
|
+
""
|
2151
|
+
]
|
1544
2152
|
}
|
1545
2153
|
]
|
package/common/stm.js
CHANGED
@@ -55,10 +55,13 @@ class API {
|
|
55
55
|
concept.value = value
|
56
56
|
}
|
57
57
|
concept.fromSTM = true
|
58
|
-
if (!concept.
|
59
|
-
concept.
|
58
|
+
if (!concept.stm) {
|
59
|
+
concept.stm = {}
|
60
60
|
}
|
61
|
-
|
61
|
+
if (!concept.stm.id) {
|
62
|
+
concept.stm.id = this.getId()
|
63
|
+
}
|
64
|
+
this._objects.mentioned = this._objects.mentioned.filter( (context) => context.stm && context.stm.id != concept.stm.id )
|
62
65
|
this._objects.mentioned.unshift(concept)
|
63
66
|
}
|
64
67
|
|
@@ -233,7 +236,7 @@ knowledgeModule( {
|
|
233
236
|
name: './stm.test.json',
|
234
237
|
contents: stm_tests,
|
235
238
|
checks: {
|
236
|
-
context: [...defaultContextCheck, 'pullFromContext', '
|
239
|
+
context: [...defaultContextCheck, 'pullFromContext', 'stm_id'],
|
237
240
|
objects: ['mentioned'],
|
238
241
|
},
|
239
242
|
},
|
package/common/stm.test.json
CHANGED
@@ -37,7 +37,9 @@
|
|
37
37
|
"end": 10,
|
38
38
|
"start": 9
|
39
39
|
},
|
40
|
-
"
|
40
|
+
"stm": {
|
41
|
+
"id": 1
|
42
|
+
},
|
41
43
|
"text": "m1",
|
42
44
|
"types": [
|
43
45
|
"memorable"
|
@@ -121,7 +123,9 @@
|
|
121
123
|
"end": 10,
|
122
124
|
"start": 9
|
123
125
|
},
|
124
|
-
"
|
126
|
+
"stm": {
|
127
|
+
"id": 1
|
128
|
+
},
|
125
129
|
"text": "m1",
|
126
130
|
"types": [
|
127
131
|
"memorable"
|
@@ -160,7 +164,9 @@
|
|
160
164
|
"end": 10,
|
161
165
|
"start": 9
|
162
166
|
},
|
163
|
-
"
|
167
|
+
"stm": {
|
168
|
+
"id": 1
|
169
|
+
},
|
164
170
|
"text": "m1",
|
165
171
|
"types": [
|
166
172
|
"memorable"
|
@@ -527,7 +533,9 @@
|
|
527
533
|
"end": 10,
|
528
534
|
"start": 9
|
529
535
|
},
|
530
|
-
"
|
536
|
+
"stm": {
|
537
|
+
"id": 1
|
538
|
+
},
|
531
539
|
"text": "m1",
|
532
540
|
"types": [
|
533
541
|
"memorable"
|
@@ -566,7 +574,9 @@
|
|
566
574
|
"end": 10,
|
567
575
|
"start": 9
|
568
576
|
},
|
569
|
-
"
|
577
|
+
"stm": {
|
578
|
+
"id": 1
|
579
|
+
},
|
570
580
|
"text": "m1",
|
571
581
|
"types": [
|
572
582
|
"memorable"
|
@@ -724,7 +734,9 @@
|
|
724
734
|
"end": 10,
|
725
735
|
"start": 9
|
726
736
|
},
|
727
|
-
"
|
737
|
+
"stm": {
|
738
|
+
"id": 1
|
739
|
+
},
|
728
740
|
"text": "m1",
|
729
741
|
"types": [
|
730
742
|
"memorable"
|
@@ -764,7 +776,9 @@
|
|
764
776
|
"end": 10,
|
765
777
|
"start": 9
|
766
778
|
},
|
767
|
-
"
|
779
|
+
"stm": {
|
780
|
+
"id": 1
|
781
|
+
},
|
768
782
|
"text": "m1",
|
769
783
|
"types": [
|
770
784
|
"memorable"
|
@@ -832,7 +846,9 @@
|
|
832
846
|
"end": 10,
|
833
847
|
"start": 9
|
834
848
|
},
|
835
|
-
"
|
849
|
+
"stm": {
|
850
|
+
"id": 1
|
851
|
+
},
|
836
852
|
"text": "m1",
|
837
853
|
"types": [
|
838
854
|
"memorable"
|
@@ -1167,7 +1183,9 @@
|
|
1167
1183
|
"end": 10,
|
1168
1184
|
"start": 9
|
1169
1185
|
},
|
1170
|
-
"
|
1186
|
+
"stm": {
|
1187
|
+
"id": 1
|
1188
|
+
},
|
1171
1189
|
"text": "m1",
|
1172
1190
|
"types": [
|
1173
1191
|
"memorable"
|
@@ -1205,7 +1223,9 @@
|
|
1205
1223
|
"end": 10,
|
1206
1224
|
"start": 9
|
1207
1225
|
},
|
1208
|
-
"
|
1226
|
+
"stm": {
|
1227
|
+
"id": 2
|
1228
|
+
},
|
1209
1229
|
"text": "m2",
|
1210
1230
|
"types": [
|
1211
1231
|
"memorable"
|
@@ -1244,7 +1264,9 @@
|
|
1244
1264
|
"end": 10,
|
1245
1265
|
"start": 9
|
1246
1266
|
},
|
1247
|
-
"
|
1267
|
+
"stm": {
|
1268
|
+
"id": 1
|
1269
|
+
},
|
1248
1270
|
"text": "m1",
|
1249
1271
|
"types": [
|
1250
1272
|
"memorable"
|
@@ -1472,7 +1494,9 @@
|
|
1472
1494
|
"end": 10,
|
1473
1495
|
"start": 9
|
1474
1496
|
},
|
1475
|
-
"
|
1497
|
+
"stm": {
|
1498
|
+
"id": 2
|
1499
|
+
},
|
1476
1500
|
"text": "m2",
|
1477
1501
|
"types": [
|
1478
1502
|
"memorable"
|
@@ -1490,7 +1514,9 @@
|
|
1490
1514
|
"end": 10,
|
1491
1515
|
"start": 9
|
1492
1516
|
},
|
1493
|
-
"
|
1517
|
+
"stm": {
|
1518
|
+
"id": 1
|
1519
|
+
},
|
1494
1520
|
"text": "m1",
|
1495
1521
|
"types": [
|
1496
1522
|
"memorable"
|
@@ -1530,7 +1556,9 @@
|
|
1530
1556
|
"end": 10,
|
1531
1557
|
"start": 9
|
1532
1558
|
},
|
1533
|
-
"
|
1559
|
+
"stm": {
|
1560
|
+
"id": 1
|
1561
|
+
},
|
1534
1562
|
"text": "m1",
|
1535
1563
|
"types": [
|
1536
1564
|
"memorable"
|
@@ -1612,7 +1640,9 @@
|
|
1612
1640
|
"end": 10,
|
1613
1641
|
"start": 9
|
1614
1642
|
},
|
1615
|
-
"
|
1643
|
+
"stm": {
|
1644
|
+
"id": 2
|
1645
|
+
},
|
1616
1646
|
"text": "m2",
|
1617
1647
|
"types": [
|
1618
1648
|
"memorable"
|
@@ -1658,7 +1688,9 @@
|
|
1658
1688
|
"end": 10,
|
1659
1689
|
"start": 9
|
1660
1690
|
},
|
1661
|
-
"
|
1691
|
+
"stm": {
|
1692
|
+
"id": 1
|
1693
|
+
},
|
1662
1694
|
"text": "m1",
|
1663
1695
|
"types": [
|
1664
1696
|
"memorable"
|
package/package.json
CHANGED
@@ -291,8 +291,8 @@
|
|
291
291
|
"table": "^6.7.1",
|
292
292
|
"base-64": "^1.0.0",
|
293
293
|
"argparse": "^2.0.1",
|
294
|
-
"theprogrammablemind_4wp": "8.0.0-beta.
|
294
|
+
"theprogrammablemind_4wp": "8.0.0-beta.36"
|
295
295
|
},
|
296
|
-
"version": "8.0.0-beta.
|
296
|
+
"version": "8.0.0-beta.36",
|
297
297
|
"license": "UNLICENSED"
|
298
298
|
}
|