tpmkms 9.8.0 → 9.9.0
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/actions.instance.json +10 -8
- package/common/actions.js +13 -11
- package/common/angle.instance.json +25 -17
- package/common/animals.instance.json +54 -28
- package/common/askfor.instance.json +89 -192
- package/common/askfor.js +49 -12
- package/common/asking.js +13 -5
- package/common/avatar.js +3 -3
- package/common/can.instance.json +32 -20
- package/common/can.js +2 -2
- package/common/colors.instance.json +44 -16
- package/common/colors.js +1 -1
- package/common/comparable.instance.json +25 -22
- package/common/compass.instance.json +9 -3
- package/common/concept.instance.json +14 -6
- package/common/concept.js +2 -0
- package/common/conjunction.js +17 -9
- package/common/control.js +10 -18
- package/common/countable.js +4 -3
- package/common/crew.instance.json +95 -27
- package/common/dateTimeSelectors.instance.json +4 -4
- package/common/dateTimeSelectors.js +4 -7
- package/common/dates.instance.json +52 -28
- package/common/dates.js +16 -11
- package/common/debug.instance.json +48 -0
- package/common/debug.js +50 -0
- package/common/debug.test.json +1 -0
- package/common/dialogues.js +126 -70
- package/common/dimension.instance.json +239 -495
- package/common/dimension.js +51 -9
- package/common/drone.instance.json +395 -84
- package/common/drone.js +43 -50
- package/common/drone_v1.instance.json +36 -12
- package/common/drone_v1.js +14 -9
- package/common/edible.instance.json +96 -32
- package/common/emotions.instance.json +15 -1
- package/common/evaluate.js +10 -13
- package/common/fastfood.instance.json +282 -100
- package/common/fastfood.js +30 -15
- package/common/formulas.instance.json +162 -24
- package/common/formulas.js +18 -9
- package/common/gdefaults.js +20 -96
- package/common/helpers/concept.js +2 -9
- package/common/helpers/conjunction.js +11 -1
- package/common/helpers/dialogues.js +48 -24
- package/common/helpers/gdefaults.js +15 -5
- package/common/helpers/properties.js +125 -326
- package/common/helpers.js +28 -58
- package/common/hierarchy.js +71 -41
- package/common/kirk.instance.json +3 -1
- package/common/latin.instance.json +10 -10
- package/common/latin.js +5 -5
- package/common/length.instance.json +247 -61
- package/common/math.instance.json +144 -5
- package/common/math.js +18 -5
- package/common/menus.instance.json +29 -11
- package/common/menus.js +8 -5
- package/common/meta.js +14 -13
- package/common/nameable.js +9 -5
- package/common/numbers.instance.json +5 -3
- package/common/numbers.js +28 -28
- package/common/ordering.instance.json +53 -4
- package/common/ordinals.js +25 -25
- package/common/people.instance.json +66 -12
- package/common/percentages.js +4 -2
- package/common/pipboy.instance.json +89 -44
- package/common/pipboy.js +21 -14
- package/common/pokemon.instance.json +39 -13
- package/common/pressure.instance.json +14 -6
- package/common/properties.instance.json +2370 -511
- package/common/properties.js +496 -78
- package/common/punctuation.js +1 -0
- package/common/rates.instance.json +2 -2
- package/common/rates.js +3 -3
- package/common/reminders.instance.json +16 -0
- package/common/reminders.js +24 -20
- package/common/reports.instance.json +11 -12
- package/common/reports.js +12 -12
- package/common/scorekeeper.js +20 -10
- package/common/sdefaults.js +30 -9
- package/common/spock.instance.json +3 -1
- package/common/stm.js +16 -21
- package/common/temperature.instance.json +19 -11
- package/common/testing.js +2 -2
- package/common/time.instance.json +104 -47
- package/common/time.js +9 -8
- package/common/ui.instance.json +4 -2
- package/common/ui.js +5 -5
- package/common/weight.instance.json +86 -21
- package/common/weight.js +5 -1
- package/common/words.js +113 -2
- package/common/wp.instance.json +125 -18
- package/common/wp.js +6 -2
- package/main.js +2 -0
- package/package.json +7 -3
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"configs": [
|
|
3
3
|
"troy modifies ounces",
|
|
4
|
+
{
|
|
5
|
+
"priorities": [
|
|
6
|
+
{
|
|
7
|
+
"context": [
|
|
8
|
+
[
|
|
9
|
+
"troy_ounce",
|
|
10
|
+
0
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"mathematical_operator",
|
|
14
|
+
0
|
|
15
|
+
]
|
|
16
|
+
],
|
|
17
|
+
"generalize": true,
|
|
18
|
+
"choose": [
|
|
19
|
+
0
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
4
24
|
"weight is a dimension",
|
|
5
25
|
"kilograms grams pounds (troy ounces) ounces and tons are units of weight",
|
|
6
26
|
"ounces = 1.097 * troy ounces",
|
|
@@ -114,7 +134,6 @@
|
|
|
114
134
|
"level": 1,
|
|
115
135
|
"context_index": 1,
|
|
116
136
|
"topLevel": true,
|
|
117
|
-
"context_id": 2,
|
|
118
137
|
"touchedBy": [
|
|
119
138
|
"weight#call2"
|
|
120
139
|
]
|
|
@@ -260,11 +279,35 @@
|
|
|
260
279
|
}
|
|
261
280
|
],
|
|
262
281
|
"learned_contextual_priorities": [],
|
|
282
|
+
"explain_associations_details": [
|
|
283
|
+
null
|
|
284
|
+
],
|
|
263
285
|
"query": "troy modifies ounces",
|
|
264
286
|
"key": {
|
|
265
287
|
"query": "troy modifies ounces"
|
|
266
288
|
}
|
|
267
289
|
},
|
|
290
|
+
{
|
|
291
|
+
"extraConfig": true,
|
|
292
|
+
"priorities": [
|
|
293
|
+
{
|
|
294
|
+
"context": [
|
|
295
|
+
[
|
|
296
|
+
"troy_ounce",
|
|
297
|
+
0
|
|
298
|
+
],
|
|
299
|
+
[
|
|
300
|
+
"mathematical_operator",
|
|
301
|
+
0
|
|
302
|
+
]
|
|
303
|
+
],
|
|
304
|
+
"generalize": true,
|
|
305
|
+
"choose": [
|
|
306
|
+
0
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
},
|
|
268
311
|
{
|
|
269
312
|
"metadata": {
|
|
270
313
|
"opChoices": [
|
|
@@ -399,7 +442,6 @@
|
|
|
399
442
|
"level": 2,
|
|
400
443
|
"context_index": 1,
|
|
401
444
|
"topLevel": true,
|
|
402
|
-
"context_id": 2,
|
|
403
445
|
"touchedBy": [
|
|
404
446
|
"weight#call2"
|
|
405
447
|
]
|
|
@@ -580,6 +622,9 @@
|
|
|
580
622
|
}
|
|
581
623
|
],
|
|
582
624
|
"learned_contextual_priorities": [],
|
|
625
|
+
"explain_associations_details": [
|
|
626
|
+
null
|
|
627
|
+
],
|
|
583
628
|
"query": "weight is a dimension",
|
|
584
629
|
"key": {
|
|
585
630
|
"query": "weight is a dimension"
|
|
@@ -1264,7 +1309,6 @@
|
|
|
1264
1309
|
"level": 2,
|
|
1265
1310
|
"context_index": 1,
|
|
1266
1311
|
"topLevel": true,
|
|
1267
|
-
"context_id": 2,
|
|
1268
1312
|
"touchedBy": [
|
|
1269
1313
|
"weight#call2"
|
|
1270
1314
|
]
|
|
@@ -2935,6 +2979,9 @@
|
|
|
2935
2979
|
}
|
|
2936
2980
|
],
|
|
2937
2981
|
"learned_contextual_priorities": [],
|
|
2982
|
+
"explain_associations_details": [
|
|
2983
|
+
null
|
|
2984
|
+
],
|
|
2938
2985
|
"query": "kilograms grams pounds (troy ounces) ounces and tons are units of weight",
|
|
2939
2986
|
"key": {
|
|
2940
2987
|
"query": "kilograms grams pounds (troy ounces) ounces and tons are units of weight"
|
|
@@ -3096,7 +3143,7 @@
|
|
|
3096
3143
|
],
|
|
3097
3144
|
"x": {
|
|
3098
3145
|
"value": 1.097,
|
|
3099
|
-
"
|
|
3146
|
+
"isInstance": true,
|
|
3100
3147
|
"text": "1.097",
|
|
3101
3148
|
"marker": "number",
|
|
3102
3149
|
"word": "1.097",
|
|
@@ -3168,7 +3215,6 @@
|
|
|
3168
3215
|
"level": 1,
|
|
3169
3216
|
"context_index": 1,
|
|
3170
3217
|
"topLevel": true,
|
|
3171
|
-
"context_id": 2,
|
|
3172
3218
|
"touchedBy": [
|
|
3173
3219
|
"weight#call2"
|
|
3174
3220
|
]
|
|
@@ -3419,6 +3465,9 @@
|
|
|
3419
3465
|
}
|
|
3420
3466
|
],
|
|
3421
3467
|
"learned_contextual_priorities": [],
|
|
3468
|
+
"explain_associations_details": [
|
|
3469
|
+
null
|
|
3470
|
+
],
|
|
3422
3471
|
"query": "ounces = 1.097 * troy ounces",
|
|
3423
3472
|
"key": {
|
|
3424
3473
|
"query": "ounces = 1.097 * troy ounces"
|
|
@@ -3620,7 +3669,7 @@
|
|
|
3620
3669
|
},
|
|
3621
3670
|
"y": {
|
|
3622
3671
|
"value": 1.097,
|
|
3623
|
-
"
|
|
3672
|
+
"isInstance": true,
|
|
3624
3673
|
"text": "1.097",
|
|
3625
3674
|
"marker": "number",
|
|
3626
3675
|
"word": "1.097",
|
|
@@ -3652,7 +3701,6 @@
|
|
|
3652
3701
|
"level": 1,
|
|
3653
3702
|
"context_index": 1,
|
|
3654
3703
|
"topLevel": true,
|
|
3655
|
-
"context_id": 2,
|
|
3656
3704
|
"touchedBy": [
|
|
3657
3705
|
"weight#call2"
|
|
3658
3706
|
]
|
|
@@ -3903,6 +3951,9 @@
|
|
|
3903
3951
|
}
|
|
3904
3952
|
],
|
|
3905
3953
|
"learned_contextual_priorities": [],
|
|
3954
|
+
"explain_associations_details": [
|
|
3955
|
+
null
|
|
3956
|
+
],
|
|
3906
3957
|
"query": "troy ounces = ounces / 1.097",
|
|
3907
3958
|
"key": {
|
|
3908
3959
|
"query": "troy ounces = ounces / 1.097"
|
|
@@ -4077,7 +4128,7 @@
|
|
|
4077
4128
|
},
|
|
4078
4129
|
"y": {
|
|
4079
4130
|
"value": 0.453592,
|
|
4080
|
-
"
|
|
4131
|
+
"isInstance": true,
|
|
4081
4132
|
"text": "0.453592",
|
|
4082
4133
|
"marker": "number",
|
|
4083
4134
|
"word": "0.453592",
|
|
@@ -4109,7 +4160,6 @@
|
|
|
4109
4160
|
"level": 1,
|
|
4110
4161
|
"context_index": 1,
|
|
4111
4162
|
"topLevel": true,
|
|
4112
|
-
"context_id": 2,
|
|
4113
4163
|
"touchedBy": [
|
|
4114
4164
|
"weight#call2"
|
|
4115
4165
|
]
|
|
@@ -4350,6 +4400,9 @@
|
|
|
4350
4400
|
}
|
|
4351
4401
|
],
|
|
4352
4402
|
"learned_contextual_priorities": [],
|
|
4403
|
+
"explain_associations_details": [
|
|
4404
|
+
null
|
|
4405
|
+
],
|
|
4353
4406
|
"query": "kilograms = pounds * 0.453592",
|
|
4354
4407
|
"key": {
|
|
4355
4408
|
"query": "kilograms = pounds * 0.453592"
|
|
@@ -4524,7 +4577,7 @@
|
|
|
4524
4577
|
},
|
|
4525
4578
|
"y": {
|
|
4526
4579
|
"value": 1000,
|
|
4527
|
-
"
|
|
4580
|
+
"isInstance": true,
|
|
4528
4581
|
"text": "1000",
|
|
4529
4582
|
"marker": "integer",
|
|
4530
4583
|
"word": "1000",
|
|
@@ -4556,7 +4609,6 @@
|
|
|
4556
4609
|
"level": 1,
|
|
4557
4610
|
"context_index": 1,
|
|
4558
4611
|
"topLevel": true,
|
|
4559
|
-
"context_id": 2,
|
|
4560
4612
|
"touchedBy": [
|
|
4561
4613
|
"weight#call2"
|
|
4562
4614
|
]
|
|
@@ -4797,6 +4849,9 @@
|
|
|
4797
4849
|
}
|
|
4798
4850
|
],
|
|
4799
4851
|
"learned_contextual_priorities": [],
|
|
4852
|
+
"explain_associations_details": [
|
|
4853
|
+
null
|
|
4854
|
+
],
|
|
4800
4855
|
"query": "grams = kilograms * 1000",
|
|
4801
4856
|
"key": {
|
|
4802
4857
|
"query": "grams = kilograms * 1000"
|
|
@@ -4971,7 +5026,7 @@
|
|
|
4971
5026
|
},
|
|
4972
5027
|
"y": {
|
|
4973
5028
|
"value": 1000,
|
|
4974
|
-
"
|
|
5029
|
+
"isInstance": true,
|
|
4975
5030
|
"text": "1000",
|
|
4976
5031
|
"marker": "integer",
|
|
4977
5032
|
"word": "1000",
|
|
@@ -5003,7 +5058,6 @@
|
|
|
5003
5058
|
"level": 1,
|
|
5004
5059
|
"context_index": 1,
|
|
5005
5060
|
"topLevel": true,
|
|
5006
|
-
"context_id": 2,
|
|
5007
5061
|
"touchedBy": [
|
|
5008
5062
|
"weight#call2"
|
|
5009
5063
|
]
|
|
@@ -5244,6 +5298,9 @@
|
|
|
5244
5298
|
}
|
|
5245
5299
|
],
|
|
5246
5300
|
"learned_contextual_priorities": [],
|
|
5301
|
+
"explain_associations_details": [
|
|
5302
|
+
null
|
|
5303
|
+
],
|
|
5247
5304
|
"query": "kilograms = grams / 1000",
|
|
5248
5305
|
"key": {
|
|
5249
5306
|
"query": "kilograms = grams / 1000"
|
|
@@ -5418,7 +5475,7 @@
|
|
|
5418
5475
|
},
|
|
5419
5476
|
"y": {
|
|
5420
5477
|
"value": 2.20462,
|
|
5421
|
-
"
|
|
5478
|
+
"isInstance": true,
|
|
5422
5479
|
"text": "2.20462",
|
|
5423
5480
|
"marker": "number",
|
|
5424
5481
|
"word": "2.20462",
|
|
@@ -5450,7 +5507,6 @@
|
|
|
5450
5507
|
"level": 1,
|
|
5451
5508
|
"context_index": 1,
|
|
5452
5509
|
"topLevel": true,
|
|
5453
|
-
"context_id": 2,
|
|
5454
5510
|
"touchedBy": [
|
|
5455
5511
|
"weight#call2"
|
|
5456
5512
|
]
|
|
@@ -5691,6 +5747,9 @@
|
|
|
5691
5747
|
}
|
|
5692
5748
|
],
|
|
5693
5749
|
"learned_contextual_priorities": [],
|
|
5750
|
+
"explain_associations_details": [
|
|
5751
|
+
null
|
|
5752
|
+
],
|
|
5694
5753
|
"query": "pounds = kilograms * 2.20462",
|
|
5695
5754
|
"key": {
|
|
5696
5755
|
"query": "pounds = kilograms * 2.20462"
|
|
@@ -5865,7 +5924,7 @@
|
|
|
5865
5924
|
},
|
|
5866
5925
|
"y": {
|
|
5867
5926
|
"value": 16,
|
|
5868
|
-
"
|
|
5927
|
+
"isInstance": true,
|
|
5869
5928
|
"text": "16",
|
|
5870
5929
|
"marker": "integer",
|
|
5871
5930
|
"word": "16",
|
|
@@ -5897,7 +5956,6 @@
|
|
|
5897
5956
|
"level": 1,
|
|
5898
5957
|
"context_index": 1,
|
|
5899
5958
|
"topLevel": true,
|
|
5900
|
-
"context_id": 2,
|
|
5901
5959
|
"touchedBy": [
|
|
5902
5960
|
"weight#call2"
|
|
5903
5961
|
]
|
|
@@ -6138,6 +6196,9 @@
|
|
|
6138
6196
|
}
|
|
6139
6197
|
],
|
|
6140
6198
|
"learned_contextual_priorities": [],
|
|
6199
|
+
"explain_associations_details": [
|
|
6200
|
+
null
|
|
6201
|
+
],
|
|
6141
6202
|
"query": "ounces = pounds * 16",
|
|
6142
6203
|
"key": {
|
|
6143
6204
|
"query": "ounces = pounds * 16"
|
|
@@ -6312,7 +6373,7 @@
|
|
|
6312
6373
|
},
|
|
6313
6374
|
"y": {
|
|
6314
6375
|
"value": 0.907185,
|
|
6315
|
-
"
|
|
6376
|
+
"isInstance": true,
|
|
6316
6377
|
"text": "0.907185",
|
|
6317
6378
|
"marker": "number",
|
|
6318
6379
|
"word": "0.907185",
|
|
@@ -6344,7 +6405,6 @@
|
|
|
6344
6405
|
"level": 1,
|
|
6345
6406
|
"context_index": 1,
|
|
6346
6407
|
"topLevel": true,
|
|
6347
|
-
"context_id": 2,
|
|
6348
6408
|
"touchedBy": [
|
|
6349
6409
|
"weight#call2"
|
|
6350
6410
|
]
|
|
@@ -6585,6 +6645,9 @@
|
|
|
6585
6645
|
}
|
|
6586
6646
|
],
|
|
6587
6647
|
"learned_contextual_priorities": [],
|
|
6648
|
+
"explain_associations_details": [
|
|
6649
|
+
null
|
|
6650
|
+
],
|
|
6588
6651
|
"query": "ton = tonne * 0.907185",
|
|
6589
6652
|
"key": {
|
|
6590
6653
|
"query": "ton = tonne * 0.907185"
|
|
@@ -6759,7 +6822,7 @@
|
|
|
6759
6822
|
},
|
|
6760
6823
|
"y": {
|
|
6761
6824
|
"value": 2000,
|
|
6762
|
-
"
|
|
6825
|
+
"isInstance": true,
|
|
6763
6826
|
"text": "2000",
|
|
6764
6827
|
"marker": "integer",
|
|
6765
6828
|
"word": "2000",
|
|
@@ -6791,7 +6854,6 @@
|
|
|
6791
6854
|
"level": 1,
|
|
6792
6855
|
"context_index": 1,
|
|
6793
6856
|
"topLevel": true,
|
|
6794
|
-
"context_id": 2,
|
|
6795
6857
|
"touchedBy": [
|
|
6796
6858
|
"weight#call2"
|
|
6797
6859
|
]
|
|
@@ -7032,6 +7094,9 @@
|
|
|
7032
7094
|
}
|
|
7033
7095
|
],
|
|
7034
7096
|
"learned_contextual_priorities": [],
|
|
7097
|
+
"explain_associations_details": [
|
|
7098
|
+
null
|
|
7099
|
+
],
|
|
7035
7100
|
"query": "pounds = ton * 2000",
|
|
7036
7101
|
"key": {
|
|
7037
7102
|
"query": "pounds = ton * 2000"
|
package/common/weight.js
CHANGED
|
@@ -18,10 +18,14 @@ const instance = require('./weight.instance.json')
|
|
|
18
18
|
const template = {
|
|
19
19
|
configs: [
|
|
20
20
|
"troy modifies ounces",
|
|
21
|
+
{
|
|
22
|
+
priorities: [
|
|
23
|
+
{ context: [["troy_ounce",0],["mathematical_operator",0]], generalize: true, choose: [0] },
|
|
24
|
+
],
|
|
25
|
+
},
|
|
21
26
|
"weight is a dimension",
|
|
22
27
|
// "kilograms grams pounds ounces and tons are units of weight",
|
|
23
28
|
"kilograms grams pounds (troy ounces) ounces and tons are units of weight",
|
|
24
|
-
// { stop: true },
|
|
25
29
|
"ounces = 1.097 * troy ounces",
|
|
26
30
|
"troy ounces = ounces / 1.097",
|
|
27
31
|
"kilograms = pounds * 0.453592",
|
package/common/words.js
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
|
+
const pluralize = require('pluralize')
|
|
1
2
|
const { knowledgeModule, where } = require('./runtime').theprogrammablemind
|
|
2
3
|
const { defaultContextCheck } = require('./helpers')
|
|
3
4
|
const words_tests = require('./words.test.json')
|
|
4
5
|
const instance = require('./words.instance.json')
|
|
5
6
|
const tokenize = require('./tokenize')
|
|
7
|
+
const englishHelpers = require('./english_helpers.js')
|
|
8
|
+
|
|
9
|
+
class API {
|
|
10
|
+
initialize({ objects }) {
|
|
11
|
+
this._objects = objects
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
toPlural(context) {
|
|
15
|
+
return this._objects.plural[context.word] || pluralize.plural(context.word)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
6
18
|
|
|
7
19
|
function initializer({objects, config, isModule}) {
|
|
8
20
|
objects.words = []
|
|
21
|
+
objects.singular = {}
|
|
22
|
+
objects.plural = {
|
|
23
|
+
'who': 'who',
|
|
24
|
+
'fahrenheit': 'fahrenheit',
|
|
25
|
+
'celcius': 'celcius',
|
|
26
|
+
}
|
|
9
27
|
config.addArgs((args) => ({
|
|
10
28
|
getWordFromDictionary: (partial) => {
|
|
11
29
|
for (const word of objects.words) {
|
|
12
30
|
let matches = true
|
|
13
31
|
for (const key in partial) {
|
|
32
|
+
if (key == 'context_id') {
|
|
33
|
+
continue
|
|
34
|
+
}
|
|
14
35
|
if (partial[key] !== word[key]) {
|
|
15
36
|
matches = false
|
|
16
37
|
}
|
|
@@ -20,23 +41,113 @@ function initializer({objects, config, isModule}) {
|
|
|
20
41
|
}
|
|
21
42
|
}
|
|
22
43
|
},
|
|
44
|
+
|
|
45
|
+
// number/gender/person etc
|
|
46
|
+
|
|
47
|
+
gw: (context, { number: numberContext } = {}) => {
|
|
48
|
+
const number = numberContext ? args.number(numberContext) : context.number;
|
|
49
|
+
return args.gp( { ...context, evaluateWord: true, number } )
|
|
50
|
+
},
|
|
51
|
+
|
|
23
52
|
addWordToDictionary: (context) => {
|
|
24
53
|
if (context.word) {
|
|
25
|
-
|
|
54
|
+
const word = { ...context }
|
|
55
|
+
delete word.range
|
|
56
|
+
objects.words = objects.words.filter((c) => JSON.stringify(c) !== JSON.stringify(word))
|
|
57
|
+
objects.words.push(word)
|
|
26
58
|
}
|
|
27
59
|
}
|
|
28
60
|
}))
|
|
29
61
|
}
|
|
30
62
|
|
|
63
|
+
const config = {
|
|
64
|
+
name: 'words',
|
|
65
|
+
operators: [
|
|
66
|
+
"([plural])",
|
|
67
|
+
"([singular])",
|
|
68
|
+
],
|
|
69
|
+
bridges: [
|
|
70
|
+
{ id: 'plural' },
|
|
71
|
+
{ id: 'singular' },
|
|
72
|
+
],
|
|
73
|
+
generators: [
|
|
74
|
+
{
|
|
75
|
+
where: where(),
|
|
76
|
+
priority: -1,
|
|
77
|
+
match: ({context}) => context.marker == 'modifies' && context.evaluateWord && context.paraphrase && context.number == 'one',
|
|
78
|
+
apply: ({context}) => 'modifies'
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
{
|
|
82
|
+
where: where(),
|
|
83
|
+
priority: -1,
|
|
84
|
+
match: ({context}) => context.marker == 'modifies' && context.evaluateWord && context.paraphrase && (context.number == 'many' || context.number > 1),
|
|
85
|
+
apply: ({context}) => 'modify'
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
{
|
|
89
|
+
where: where(),
|
|
90
|
+
priority: -1,
|
|
91
|
+
match: ({context}) => context.evaluateWord && context.isVerb && context.paraphrase && context.word && !context.imperative && !context.interpolate,
|
|
92
|
+
apply: ({context}) => {
|
|
93
|
+
const infinitive = englishHelpers.getInfinitive(context.word)
|
|
94
|
+
if (context.form == 'infinitive') {
|
|
95
|
+
const cases = englishHelpers.conjugateVerb(infinitive)
|
|
96
|
+
const def = cases.find((def) => def.form == context.form)
|
|
97
|
+
return def.word
|
|
98
|
+
} else if (context.tense) {
|
|
99
|
+
const cases = englishHelpers.conjugateVerb(infinitive)
|
|
100
|
+
const def = cases.find((def) => def.tense == context.tense)
|
|
101
|
+
return def.word
|
|
102
|
+
} else {
|
|
103
|
+
return pluralize.plural(context.word)
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
{
|
|
109
|
+
where: where(),
|
|
110
|
+
priority: -1,
|
|
111
|
+
match: ({context}) => context.evaluateWord && context.paraphrase && context.word && (context.number == 'many' || context.number > 1) && !context.interpolate,
|
|
112
|
+
apply: ({context, objects}) => {
|
|
113
|
+
const override = objects.plural[context.word]
|
|
114
|
+
return override || pluralize.plural(context.word)
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
{
|
|
119
|
+
where: where(),
|
|
120
|
+
priority: -1,
|
|
121
|
+
match: ({context}) => context.evaluateWord && context.isVerb && context.paraphrase && context.word && context.number == 'one' && !context.imperative && !context.interpolate,
|
|
122
|
+
apply: ({context}) => {
|
|
123
|
+
const infinitive = englishHelpers.getInfinitive(context.word)
|
|
124
|
+
const cases = englishHelpers.conjugateVerb(infinitive)
|
|
125
|
+
return pluralize.plural(context.word)
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
{
|
|
130
|
+
where: where(),
|
|
131
|
+
priority: -1,
|
|
132
|
+
match: ({context}) => context.evaluateWord && context.paraphrase && context.word && context.number == 'one' && !context.interpolate,
|
|
133
|
+
apply: ({context, objects}) => {
|
|
134
|
+
const override = objects.singular[context.word]
|
|
135
|
+
return override || pluralize.singular(context.word)
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
}
|
|
140
|
+
|
|
31
141
|
const template = {
|
|
32
142
|
configs: [],
|
|
33
143
|
fragments: [],
|
|
34
144
|
}
|
|
35
145
|
|
|
36
146
|
knowledgeModule( {
|
|
37
|
-
config
|
|
147
|
+
config,
|
|
38
148
|
includes: [tokenize],
|
|
39
149
|
initializer,
|
|
150
|
+
api: () => new API(),
|
|
40
151
|
|
|
41
152
|
module,
|
|
42
153
|
description: 'talking about words',
|