solve-engine 1.1.0 → 1.1.1
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/dist/{chunk-RRLHC37V.js → chunk-4HQKTMWG.js} +4 -4
- package/dist/{chunk-RRLHC37V.js.map → chunk-4HQKTMWG.js.map} +1 -1
- package/dist/{chunk-JJIXHXFQ.js → chunk-BYJBUL7U.js} +3 -3
- package/dist/{chunk-JJIXHXFQ.js.map → chunk-BYJBUL7U.js.map} +1 -1
- package/dist/{chunk-C75AFGVD.cjs → chunk-CUR2WLI4.cjs} +5 -5
- package/dist/{chunk-C75AFGVD.cjs.map → chunk-CUR2WLI4.cjs.map} +1 -1
- package/dist/{chunk-OADDUPT3.js → chunk-DLEBSLF4.js} +3 -3
- package/dist/{chunk-OADDUPT3.js.map → chunk-DLEBSLF4.js.map} +1 -1
- package/dist/{chunk-ZXCESUJS.cjs → chunk-E23GZEWL.cjs} +3 -3
- package/dist/{chunk-ZXCESUJS.cjs.map → chunk-E23GZEWL.cjs.map} +1 -1
- package/dist/{chunk-G7Z4HJQA.js → chunk-GLA4JXBO.js} +3 -3
- package/dist/{chunk-G7Z4HJQA.js.map → chunk-GLA4JXBO.js.map} +1 -1
- package/dist/{chunk-GQMUHVE3.js → chunk-JG6ZJ2WU.js} +15 -2
- package/dist/chunk-JG6ZJ2WU.js.map +1 -0
- package/dist/{chunk-GUG7SNSV.js → chunk-LHZ6VOA7.js} +5 -5
- package/dist/{chunk-GUG7SNSV.js.map → chunk-LHZ6VOA7.js.map} +1 -1
- package/dist/{chunk-OTN6SZOD.cjs → chunk-MN3LHRGV.cjs} +53 -53
- package/dist/{chunk-OTN6SZOD.cjs.map → chunk-MN3LHRGV.cjs.map} +1 -1
- package/dist/{chunk-XJGJCF2R.cjs → chunk-N5NNW4VG.cjs} +4 -4
- package/dist/{chunk-XJGJCF2R.cjs.map → chunk-N5NNW4VG.cjs.map} +1 -1
- package/dist/{chunk-JIPATHVY.js → chunk-NNZAEUDW.js} +7 -7
- package/dist/{chunk-JIPATHVY.js.map → chunk-NNZAEUDW.js.map} +1 -1
- package/dist/{chunk-MG6Q3DUO.cjs → chunk-T6ZYQJ63.cjs} +22 -22
- package/dist/{chunk-MG6Q3DUO.cjs.map → chunk-T6ZYQJ63.cjs.map} +1 -1
- package/dist/{chunk-SNHVVOJK.cjs → chunk-YRIKITGF.cjs} +11 -11
- package/dist/{chunk-SNHVVOJK.cjs.map → chunk-YRIKITGF.cjs.map} +1 -1
- package/dist/{chunk-YTIYVHL7.cjs → chunk-ZMW6NU2K.cjs} +15 -2
- package/dist/chunk-ZMW6NU2K.cjs.map +1 -0
- package/dist/constants.cjs +4 -4
- package/dist/constants.js +1 -1
- package/dist/engine.cjs +20 -20
- package/dist/engine.js +7 -7
- package/dist/index.cjs +17 -17
- package/dist/index.js +8 -8
- package/dist/lexer.cjs +8 -8
- package/dist/lexer.js +2 -2
- package/dist/normalizer.cjs +8 -8
- package/dist/normalizer.js +2 -2
- package/dist/packages.cjs +28 -28
- package/dist/packages.js +3 -3
- package/dist/testing.cjs +10 -10
- package/dist/testing.js +6 -6
- package/dist/worker.cjs +8 -8
- package/dist/worker.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-GQMUHVE3.js.map +0 -1
- package/dist/chunk-YTIYVHL7.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkJ45BCEZ4_cjs = require('./chunk-J45BCEZ4.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkCUR2WLI4_cjs = require('./chunk-CUR2WLI4.cjs');
|
|
5
5
|
var chunkADBA3XBE_cjs = require('./chunk-ADBA3XBE.cjs');
|
|
6
6
|
var chunkSSV46KFA_cjs = require('./chunk-SSV46KFA.cjs');
|
|
7
7
|
var chunkZ2XP767T_cjs = require('./chunk-Z2XP767T.cjs');
|
|
@@ -12,7 +12,7 @@ var chunkALYRJ72W_cjs = require('./chunk-ALYRJ72W.cjs');
|
|
|
12
12
|
var chunkHIQ5HSZL_cjs = require('./chunk-HIQ5HSZL.cjs');
|
|
13
13
|
var chunk2TZKENDH_cjs = require('./chunk-2TZKENDH.cjs');
|
|
14
14
|
var chunkEJ3ILXX6_cjs = require('./chunk-EJ3ILXX6.cjs');
|
|
15
|
-
var
|
|
15
|
+
var chunkZMW6NU2K_cjs = require('./chunk-ZMW6NU2K.cjs');
|
|
16
16
|
var chunkQFTDTX6K_cjs = require('./chunk-QFTDTX6K.cjs');
|
|
17
17
|
var chunkOUHT5Z36_cjs = require('./chunk-OUHT5Z36.cjs');
|
|
18
18
|
var chunkAQNHHJMJ_cjs = require('./chunk-AQNHHJMJ.cjs');
|
|
@@ -181,7 +181,7 @@ function largeNumberSuffixNormalizerRule(priority = 65) {
|
|
|
181
181
|
const scaled = scaleDecimalString(numberToken.text, magnitude);
|
|
182
182
|
return {
|
|
183
183
|
consumed: 2,
|
|
184
|
-
replacement: [
|
|
184
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("NUMBER", scaled, tokens.slice(pos, pos + 2))],
|
|
185
185
|
ruleName: "arithmetic:large-number-suffix"
|
|
186
186
|
};
|
|
187
187
|
}
|
|
@@ -400,7 +400,7 @@ function percentOnOffNormalizerRule(priority = 68) {
|
|
|
400
400
|
consumed: 2,
|
|
401
401
|
replacement: [
|
|
402
402
|
tokens[pos],
|
|
403
|
-
|
|
403
|
+
chunkCUR2WLI4_cjs.createFusedToken(text === "on" ? "PCT_ON" : "PCT_OFF", text, [word])
|
|
404
404
|
],
|
|
405
405
|
ruleName: "percentage:on-off"
|
|
406
406
|
};
|
|
@@ -603,7 +603,7 @@ function stepTokenAt(tokens, i) {
|
|
|
603
603
|
if (text !== "up" && text !== "down") return null;
|
|
604
604
|
if (tokens[i + 1]?.type !== "NUMBER") return null;
|
|
605
605
|
if (tokens[i + 2]?.type !== "PERCENT") return null;
|
|
606
|
-
return
|
|
606
|
+
return chunkCUR2WLI4_cjs.createFusedToken(text === "up" ? "PCT_UP" : "PCT_DOWN", text, [word]);
|
|
607
607
|
}
|
|
608
608
|
function percentUpDownNormalizerRule(priority = 68) {
|
|
609
609
|
return {
|
|
@@ -1222,7 +1222,7 @@ function untilSinceNormalizerRule(priority = 60) {
|
|
|
1222
1222
|
const fusedType = keywordToken.type === "UNTIL" ? "UNTIL_UNIT" : "SINCE_UNIT";
|
|
1223
1223
|
return {
|
|
1224
1224
|
consumed: 2,
|
|
1225
|
-
replacement: [
|
|
1225
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken(fusedType, unitToken.value, [unitToken, keywordToken])],
|
|
1226
1226
|
ruleName: `datetime:${keywordToken.type.toLowerCase()}`
|
|
1227
1227
|
};
|
|
1228
1228
|
}
|
|
@@ -1259,7 +1259,7 @@ function betweenUnitNormalizerRule(priority = 60) {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
return {
|
|
1261
1261
|
consumed: howManyLength + 2,
|
|
1262
|
-
replacement: [
|
|
1262
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("BETWEEN_UNIT", unitToken.value, sources)],
|
|
1263
1263
|
ruleName: "datetime:between"
|
|
1264
1264
|
};
|
|
1265
1265
|
}
|
|
@@ -1324,7 +1324,7 @@ function buildDateToken(day, month, year, sourceTokens, ruleName) {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
const first = sourceTokens[0];
|
|
1326
1326
|
const text = sourceTokens.map((t) => t.value).join("");
|
|
1327
|
-
const fusedToken = new
|
|
1327
|
+
const fusedToken = new chunkZMW6NU2K_cjs.LexerToken(
|
|
1328
1328
|
DATETIME_LITERAL_TYPE,
|
|
1329
1329
|
DATETIME_LITERAL_TYPE_ID,
|
|
1330
1330
|
String(date.getTime()),
|
|
@@ -1365,7 +1365,7 @@ function fuseIsoTimestamp(tokens, pos, ruleName) {
|
|
|
1365
1365
|
if (covered !== matched[0].length) return null;
|
|
1366
1366
|
const epochMs = parseIso8601(matched[0]);
|
|
1367
1367
|
if (epochMs === null) return null;
|
|
1368
|
-
const fusedToken = new
|
|
1368
|
+
const fusedToken = new chunkZMW6NU2K_cjs.LexerToken(
|
|
1369
1369
|
DATETIME_LITERAL_TYPE,
|
|
1370
1370
|
DATETIME_LITERAL_TYPE_ID,
|
|
1371
1371
|
String(epochMs),
|
|
@@ -1624,7 +1624,7 @@ function daysInPeriodNormalizerRule(priority = 60) {
|
|
|
1624
1624
|
if (!startsPeriod(tokens[pos + 2])) return null;
|
|
1625
1625
|
return {
|
|
1626
1626
|
consumed: 2,
|
|
1627
|
-
replacement: [
|
|
1627
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("DAYS_IN_PERIOD", "days in", [days, tokens[pos + 1]])],
|
|
1628
1628
|
ruleName: "datetime:days-in-period"
|
|
1629
1629
|
};
|
|
1630
1630
|
}
|
|
@@ -2403,7 +2403,7 @@ function clockTimeNormalizerRule(priority = 65) {
|
|
|
2403
2403
|
name: "time:clock-time",
|
|
2404
2404
|
priority,
|
|
2405
2405
|
match(tokens, pos) {
|
|
2406
|
-
if (
|
|
2406
|
+
if (chunkCUR2WLI4_cjs.isInsideRangeContext(tokens, pos)) return null;
|
|
2407
2407
|
const hourToken = tokens[pos];
|
|
2408
2408
|
if (hourToken.type !== "NUMBER") return null;
|
|
2409
2409
|
const hour = parseInt(hourToken.value, 10);
|
|
@@ -2419,7 +2419,7 @@ function clockTimeNormalizerRule(priority = 65) {
|
|
|
2419
2419
|
const consumed = hasAmPm ? 4 : 3;
|
|
2420
2420
|
return {
|
|
2421
2421
|
consumed,
|
|
2422
|
-
replacement: [
|
|
2422
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("CLOCK_TIME", String(totalMinutes), tokens.slice(pos, pos + consumed))],
|
|
2423
2423
|
ruleName: "time:clock-time"
|
|
2424
2424
|
};
|
|
2425
2425
|
}
|
|
@@ -2429,7 +2429,7 @@ function clockTimeNormalizerRule(priority = 65) {
|
|
|
2429
2429
|
if (totalMinutes === null) return null;
|
|
2430
2430
|
return {
|
|
2431
2431
|
consumed: 2,
|
|
2432
|
-
replacement: [
|
|
2432
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("CLOCK_TIME", String(totalMinutes), tokens.slice(pos, pos + 2))],
|
|
2433
2433
|
ruleName: "time:clock-time"
|
|
2434
2434
|
};
|
|
2435
2435
|
}
|
|
@@ -2452,7 +2452,7 @@ function clockTimeIntervalNormalizerRule(priority = 66) {
|
|
|
2452
2452
|
if (end?.type !== "CLOCK_TIME") return null;
|
|
2453
2453
|
return {
|
|
2454
2454
|
consumed: 3,
|
|
2455
|
-
replacement: [
|
|
2455
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("CLOCK_TIME_INTERVAL", `${start.value}:${end.value}`, tokens.slice(pos, pos + 3))],
|
|
2456
2456
|
ruleName: "time:clock-time-interval"
|
|
2457
2457
|
};
|
|
2458
2458
|
}
|
|
@@ -2471,7 +2471,7 @@ function fpsRateNormalizerRule(priority = 65) {
|
|
|
2471
2471
|
if (fpsToken?.type !== "IDENT" || fpsToken.value.toLowerCase() !== "fps") return null;
|
|
2472
2472
|
return {
|
|
2473
2473
|
consumed: 2,
|
|
2474
|
-
replacement: [
|
|
2474
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("FPS_RATE", numberToken.value, tokens.slice(pos, pos + 2))],
|
|
2475
2475
|
ruleName: "time:fps-rate"
|
|
2476
2476
|
};
|
|
2477
2477
|
}
|
|
@@ -2484,7 +2484,7 @@ function laptimeNormalizerRule(priority = 70) {
|
|
|
2484
2484
|
name: "time:laptime",
|
|
2485
2485
|
priority,
|
|
2486
2486
|
match(tokens, pos) {
|
|
2487
|
-
if (
|
|
2487
|
+
if (chunkCUR2WLI4_cjs.isInsideRangeContext(tokens, pos)) return null;
|
|
2488
2488
|
const h = tokens[pos];
|
|
2489
2489
|
const c1 = tokens[pos + 1];
|
|
2490
2490
|
const m = tokens[pos + 2];
|
|
@@ -2503,7 +2503,7 @@ function laptimeNormalizerRule(priority = 70) {
|
|
|
2503
2503
|
const totalSeconds = hours * 3600 + minutes * 60 + seconds;
|
|
2504
2504
|
return {
|
|
2505
2505
|
consumed: 5,
|
|
2506
|
-
replacement: [
|
|
2506
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("LAPTIME", String(totalSeconds), tokens.slice(pos, pos + 5))],
|
|
2507
2507
|
ruleName: "time:laptime"
|
|
2508
2508
|
};
|
|
2509
2509
|
}
|
|
@@ -2516,7 +2516,7 @@ function videoTimecodeNormalizerRule(priority = 75) {
|
|
|
2516
2516
|
name: "time:video-timecode",
|
|
2517
2517
|
priority,
|
|
2518
2518
|
match(tokens, pos) {
|
|
2519
|
-
if (
|
|
2519
|
+
if (chunkCUR2WLI4_cjs.isInsideRangeContext(tokens, pos)) return null;
|
|
2520
2520
|
const h = tokens[pos];
|
|
2521
2521
|
const c1 = tokens[pos + 1];
|
|
2522
2522
|
const m = tokens[pos + 2];
|
|
@@ -2542,7 +2542,7 @@ function videoTimecodeNormalizerRule(priority = 75) {
|
|
|
2542
2542
|
return {
|
|
2543
2543
|
consumed: 7,
|
|
2544
2544
|
replacement: [
|
|
2545
|
-
|
|
2545
|
+
chunkCUR2WLI4_cjs.createFusedToken("VIDEO_TIMECODE", `${hours},${minutes},${seconds},${frames}`, tokens.slice(pos, pos + 7))
|
|
2546
2546
|
],
|
|
2547
2547
|
ruleName: "time:video-timecode"
|
|
2548
2548
|
};
|
|
@@ -2562,7 +2562,7 @@ function frameCountNormalizerRule(priority = 65) {
|
|
|
2562
2562
|
if (framesToken?.type !== "IDENT" || framesToken.value.toLowerCase() !== "frames") return null;
|
|
2563
2563
|
return {
|
|
2564
2564
|
consumed: 2,
|
|
2565
|
-
replacement: [
|
|
2565
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("FRAME_COUNT", numberToken.value, tokens.slice(pos, pos + 2))],
|
|
2566
2566
|
ruleName: "time:frame-count"
|
|
2567
2567
|
};
|
|
2568
2568
|
}
|
|
@@ -3226,7 +3226,7 @@ function uomPossibilitiesNormalizerRule(priority = 60) {
|
|
|
3226
3226
|
if (questionToken.type !== "QUESTION") return null;
|
|
3227
3227
|
return {
|
|
3228
3228
|
consumed: 3,
|
|
3229
|
-
replacement: [
|
|
3229
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("UOM_POSSIBILITIES_QUERY", unitToken.value, [unitToken, toToken, questionToken])],
|
|
3230
3230
|
ruleName: "uom:possibilities"
|
|
3231
3231
|
};
|
|
3232
3232
|
}
|
|
@@ -3278,8 +3278,8 @@ function compoundQuantityNormalizerRule(priority = 63) {
|
|
|
3278
3278
|
return {
|
|
3279
3279
|
consumed,
|
|
3280
3280
|
replacement: [
|
|
3281
|
-
|
|
3282
|
-
|
|
3281
|
+
chunkCUR2WLI4_cjs.createFusedToken("NUMBER", String(scaled), source),
|
|
3282
|
+
chunkCUR2WLI4_cjs.createFusedToken("UNIT", smallestUnit, [smallestUnitToken])
|
|
3283
3283
|
],
|
|
3284
3284
|
ruleName: "uom:compound-quantity"
|
|
3285
3285
|
};
|
|
@@ -3307,7 +3307,7 @@ function twoUnitConversionNormalizerRule(priority = 59) {
|
|
|
3307
3307
|
return {
|
|
3308
3308
|
consumed: 4,
|
|
3309
3309
|
replacement: [
|
|
3310
|
-
|
|
3310
|
+
chunkCUR2WLI4_cjs.createFusedToken("IN_TWO_UNITS", `${major} ${minor}`, tokens.slice(pos, pos + 4))
|
|
3311
3311
|
],
|
|
3312
3312
|
ruleName: "uom:two-unit-conversion"
|
|
3313
3313
|
};
|
|
@@ -3328,7 +3328,7 @@ function degreeSymbolNormalizerRule(priority = 74) {
|
|
|
3328
3328
|
if ((symbol.text ?? symbol.value ?? "") !== "\xB0") return null;
|
|
3329
3329
|
return {
|
|
3330
3330
|
consumed: 2,
|
|
3331
|
-
replacement: [number,
|
|
3331
|
+
replacement: [number, chunkCUR2WLI4_cjs.createFusedToken("UNIT", "degrees", [symbol])],
|
|
3332
3332
|
ruleName: "uom:degree-symbol"
|
|
3333
3333
|
};
|
|
3334
3334
|
}
|
|
@@ -3380,7 +3380,7 @@ function bareRateDenominatorNormalizerRule(priority = 75) {
|
|
|
3380
3380
|
if (introduces && isUnit2(tokens[pos + 3])) {
|
|
3381
3381
|
return {
|
|
3382
3382
|
consumed: 2,
|
|
3383
|
-
replacement: [head,
|
|
3383
|
+
replacement: [head, chunkCUR2WLI4_cjs.createFusedToken("UNIT", label.value, [label])],
|
|
3384
3384
|
ruleName: "uom:bare-rate-denominator"
|
|
3385
3385
|
};
|
|
3386
3386
|
}
|
|
@@ -3394,7 +3394,7 @@ function bareRateDenominatorNormalizerRule(priority = 75) {
|
|
|
3394
3394
|
return {
|
|
3395
3395
|
consumed: 2,
|
|
3396
3396
|
replacement: [
|
|
3397
|
-
|
|
3397
|
+
chunkCUR2WLI4_cjs.createFusedToken("PER_UNIT", unitToken.value, [head, unitToken])
|
|
3398
3398
|
],
|
|
3399
3399
|
ruleName: "uom:bare-rate-denominator"
|
|
3400
3400
|
};
|
|
@@ -3459,7 +3459,7 @@ function atRateNormalizerRule(priority = 73) {
|
|
|
3459
3459
|
if (!hasRateAhead(tokens, pos + 1)) return null;
|
|
3460
3460
|
return {
|
|
3461
3461
|
consumed: 1,
|
|
3462
|
-
replacement: [
|
|
3462
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("AT_RATE", "at", [tokens[pos]])],
|
|
3463
3463
|
ruleName: "uom:at-rate"
|
|
3464
3464
|
};
|
|
3465
3465
|
}
|
|
@@ -3486,8 +3486,8 @@ function forDurationNormalizerRule(priority = 76) {
|
|
|
3486
3486
|
return {
|
|
3487
3487
|
consumed: 3,
|
|
3488
3488
|
replacement: [
|
|
3489
|
-
|
|
3490
|
-
|
|
3489
|
+
chunkCUR2WLI4_cjs.createFusedToken("STAR", "*", [head]),
|
|
3490
|
+
chunkCUR2WLI4_cjs.createFusedToken("NUMBER", "1", [article]),
|
|
3491
3491
|
tokens[pos + 2]
|
|
3492
3492
|
],
|
|
3493
3493
|
ruleName: "uom:for-duration"
|
|
@@ -3524,7 +3524,7 @@ function reversedConversionNormalizerRule(priority = 61) {
|
|
|
3524
3524
|
return {
|
|
3525
3525
|
consumed: 4,
|
|
3526
3526
|
replacement: [
|
|
3527
|
-
|
|
3527
|
+
chunkCUR2WLI4_cjs.createFusedToken("NUMBER", "1", [third]),
|
|
3528
3528
|
tokens[pos + 3],
|
|
3529
3529
|
tokens[pos + 1],
|
|
3530
3530
|
target
|
|
@@ -3723,7 +3723,7 @@ function ingredientNameNormalizerRule(priority = 68) {
|
|
|
3723
3723
|
const candidate = candidateTokens.map((t) => t.value.toLowerCase()).join(" ");
|
|
3724
3724
|
return {
|
|
3725
3725
|
consumed: wordCount,
|
|
3726
|
-
replacement: [
|
|
3726
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("INGREDIENT_NAME", candidate, candidateTokens)],
|
|
3727
3727
|
ruleName: "uom-cooking:ingredient-name"
|
|
3728
3728
|
};
|
|
3729
3729
|
}
|
|
@@ -3746,7 +3746,7 @@ function multiWordUnitNormalizerRule(priority = 78) {
|
|
|
3746
3746
|
if (chunkAMOJYLG2_cjs.UNIT_TABLE[spelling] === void 0) return null;
|
|
3747
3747
|
return {
|
|
3748
3748
|
consumed: 2,
|
|
3749
|
-
replacement: [
|
|
3749
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("UNIT", spelling, tokens.slice(pos, pos + 2))],
|
|
3750
3750
|
ruleName: "uom:multi-word-unit"
|
|
3751
3751
|
};
|
|
3752
3752
|
}
|
|
@@ -3768,7 +3768,7 @@ function compoundUnitNormalizerRule(priority = 77) {
|
|
|
3768
3768
|
const spelling = `${numerator.value}/${denominator.value}`;
|
|
3769
3769
|
return {
|
|
3770
3770
|
consumed: 3,
|
|
3771
|
-
replacement: [
|
|
3771
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("UNIT", spelling, [numerator, slash, denominator])],
|
|
3772
3772
|
ruleName: "uom:compound-unit"
|
|
3773
3773
|
};
|
|
3774
3774
|
}
|
|
@@ -4275,7 +4275,7 @@ function mapReduceCallNormalizerRule(priority = 80) {
|
|
|
4275
4275
|
return {
|
|
4276
4276
|
consumed: 1,
|
|
4277
4277
|
replacement: [
|
|
4278
|
-
new
|
|
4278
|
+
new chunkZMW6NU2K_cjs.LexerToken(tokenType, chunkQFTDTX6K_cjs.tokenTypeId(tokenType), token.value, token.value, token.offset, 0, token.line, token.col)
|
|
4279
4279
|
],
|
|
4280
4280
|
ruleName: "mapreduce:call"
|
|
4281
4281
|
};
|
|
@@ -4600,7 +4600,7 @@ function imaginaryLiteralNormalizerRule(priority = 75) {
|
|
|
4600
4600
|
return {
|
|
4601
4601
|
consumed: 2,
|
|
4602
4602
|
replacement: [
|
|
4603
|
-
new
|
|
4603
|
+
new chunkZMW6NU2K_cjs.LexerToken(
|
|
4604
4604
|
"IMAGINARY",
|
|
4605
4605
|
chunkQFTDTX6K_cjs.tokenTypeId("IMAGINARY"),
|
|
4606
4606
|
number.value,
|
|
@@ -4646,7 +4646,7 @@ function symbolicCallNormalizerRule(priority = 80) {
|
|
|
4646
4646
|
return {
|
|
4647
4647
|
consumed: 1,
|
|
4648
4648
|
replacement: [
|
|
4649
|
-
new
|
|
4649
|
+
new chunkZMW6NU2K_cjs.LexerToken(tokenType, chunkQFTDTX6K_cjs.tokenTypeId(tokenType), token.value, token.value, token.offset, 0, token.line, token.col)
|
|
4650
4650
|
],
|
|
4651
4651
|
ruleName: "symbolic:call"
|
|
4652
4652
|
};
|
|
@@ -5087,7 +5087,7 @@ function decimalPlacesNormalizerRule(priority = 66) {
|
|
|
5087
5087
|
return {
|
|
5088
5088
|
consumed,
|
|
5089
5089
|
replacement: [
|
|
5090
|
-
|
|
5090
|
+
chunkCUR2WLI4_cjs.createFusedToken("DECIMAL_PLACES", count.value, tokens.slice(pos, pos + consumed))
|
|
5091
5091
|
],
|
|
5092
5092
|
ruleName: "converters:decimal-places"
|
|
5093
5093
|
};
|
|
@@ -5109,7 +5109,7 @@ function converterPrepositionNormalizerRule(priority = 67) {
|
|
|
5109
5109
|
if (!isConverterTarget) return null;
|
|
5110
5110
|
return {
|
|
5111
5111
|
consumed: 1,
|
|
5112
|
-
replacement: [
|
|
5112
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("AS", "as", [preposition])],
|
|
5113
5113
|
ruleName: "converters:preposition"
|
|
5114
5114
|
};
|
|
5115
5115
|
}
|
|
@@ -5242,15 +5242,15 @@ function functionPhraseNormalizerRule(priority = 69) {
|
|
|
5242
5242
|
if (word === "root") {
|
|
5243
5243
|
return {
|
|
5244
5244
|
consumed: 1,
|
|
5245
|
-
replacement: [
|
|
5245
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("NTH_ROOT", "root", [head])],
|
|
5246
5246
|
ruleName: "mathphrases:function-phrase"
|
|
5247
5247
|
};
|
|
5248
5248
|
}
|
|
5249
5249
|
const baseAt = findBase(tokens, pos + 1);
|
|
5250
5250
|
if (baseAt === -1) return null;
|
|
5251
5251
|
const replacement = tokens.slice(pos, baseAt + 1).map((token, index) => {
|
|
5252
|
-
if (index === 0) return
|
|
5253
|
-
if (index === baseAt - pos) return
|
|
5252
|
+
if (index === 0) return chunkCUR2WLI4_cjs.createFusedToken("LOG_PHRASE", "log", [token]);
|
|
5253
|
+
if (index === baseAt - pos) return chunkCUR2WLI4_cjs.createFusedToken("LOG_BASE", "base", [token]);
|
|
5254
5254
|
return token;
|
|
5255
5255
|
});
|
|
5256
5256
|
return {
|
|
@@ -5806,7 +5806,7 @@ function inYearDollarsNormalizerRule(priority = 70) {
|
|
|
5806
5806
|
if (word !== "dollars" && word !== "dollar") return null;
|
|
5807
5807
|
return {
|
|
5808
5808
|
consumed: 3,
|
|
5809
|
-
replacement: [
|
|
5809
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("IN_YEAR_DOLLARS", yearToken.value, tokens.slice(pos, pos + 3))],
|
|
5810
5810
|
ruleName: "finance:in-year-dollars"
|
|
5811
5811
|
};
|
|
5812
5812
|
}
|
|
@@ -5928,8 +5928,8 @@ function recurringScheduleNormalizerRule(priority = 78) {
|
|
|
5928
5928
|
// `pos` and pass through on their own.
|
|
5929
5929
|
replacement: [
|
|
5930
5930
|
amount,
|
|
5931
|
-
|
|
5932
|
-
|
|
5931
|
+
chunkCUR2WLI4_cjs.createFusedToken("STAR", "*", source),
|
|
5932
|
+
chunkCUR2WLI4_cjs.createFusedToken("NUMBER", String(count), source)
|
|
5933
5933
|
],
|
|
5934
5934
|
consumed,
|
|
5935
5935
|
ruleName: "finance:recurring-schedule"
|
|
@@ -6521,7 +6521,7 @@ function stockTickerNormalizerRule() {
|
|
|
6521
6521
|
if (!token || token.type !== "IDENT") return null;
|
|
6522
6522
|
if (!MAJOR_TICKERS.has(token.value)) return null;
|
|
6523
6523
|
if (pos > 0 && tokens[pos - 1].type === "COLON") return null;
|
|
6524
|
-
const fusedToken = new
|
|
6524
|
+
const fusedToken = new chunkZMW6NU2K_cjs.LexerToken(
|
|
6525
6525
|
STOCK_TICKER_TYPE,
|
|
6526
6526
|
STOCK_TICKER_TYPE_ID,
|
|
6527
6527
|
token.value,
|
|
@@ -6966,7 +6966,7 @@ function lineRefNormalizerRule() {
|
|
|
6966
6966
|
};
|
|
6967
6967
|
}
|
|
6968
6968
|
function makeLineRefToken(lineNumberText, sourceToken) {
|
|
6969
|
-
return new
|
|
6969
|
+
return new chunkZMW6NU2K_cjs.LexerToken(
|
|
6970
6970
|
"LINE_REF",
|
|
6971
6971
|
LINE_REF_TYPE_ID,
|
|
6972
6972
|
lineNumberText,
|
|
@@ -6992,7 +6992,7 @@ function rangeCallNormalizerRule() {
|
|
|
6992
6992
|
return {
|
|
6993
6993
|
consumed: 1,
|
|
6994
6994
|
replacement: [
|
|
6995
|
-
new
|
|
6995
|
+
new chunkZMW6NU2K_cjs.LexerToken(tokenType, typeId, token.value, token.value, token.offset, 0, token.line, token.col)
|
|
6996
6996
|
],
|
|
6997
6997
|
ruleName: "lines:range-call"
|
|
6998
6998
|
};
|
|
@@ -7312,7 +7312,7 @@ function asciiPlusMinusNormalizerRule(priority = 90) {
|
|
|
7312
7312
|
if (minus?.type !== "MINUS") return null;
|
|
7313
7313
|
return {
|
|
7314
7314
|
consumed: 3,
|
|
7315
|
-
replacement: [
|
|
7315
|
+
replacement: [chunkCUR2WLI4_cjs.createFusedToken("PLUS_MINUS", "\xB1", [plus, slash, minus])],
|
|
7316
7316
|
ruleName: "uncertainty:ascii-plus-minus"
|
|
7317
7317
|
};
|
|
7318
7318
|
}
|
|
@@ -7513,7 +7513,7 @@ function goalSeekNormalizerRule(priority = 75) {
|
|
|
7513
7513
|
return {
|
|
7514
7514
|
consumed: 1,
|
|
7515
7515
|
replacement: [
|
|
7516
|
-
new
|
|
7516
|
+
new chunkZMW6NU2K_cjs.LexerToken("GOAL_SEEK", GOAL_SEEK_TYPE_ID, token.value, token.value, token.offset, 0, token.line, token.col)
|
|
7517
7517
|
],
|
|
7518
7518
|
ruleName: "goalseek:solve-line"
|
|
7519
7519
|
};
|
|
@@ -7905,7 +7905,7 @@ function colourCallNormalizerRule(priority = 80) {
|
|
|
7905
7905
|
return {
|
|
7906
7906
|
consumed: 1,
|
|
7907
7907
|
replacement: [
|
|
7908
|
-
new
|
|
7908
|
+
new chunkZMW6NU2K_cjs.LexerToken(
|
|
7909
7909
|
"COLOUR_CALL",
|
|
7910
7910
|
chunkQFTDTX6K_cjs.tokenTypeId("COLOUR_CALL"),
|
|
7911
7911
|
token.value,
|
|
@@ -8008,5 +8008,5 @@ exports.containsSymbolicCall = containsSymbolicCall;
|
|
|
8008
8008
|
exports.createCurrencyPackage = createCurrencyPackage;
|
|
8009
8009
|
exports.createKnowledgePackage = createKnowledgePackage;
|
|
8010
8010
|
exports.createStocksPackage = createStocksPackage;
|
|
8011
|
-
//# sourceMappingURL=chunk-
|
|
8012
|
-
//# sourceMappingURL=chunk-
|
|
8011
|
+
//# sourceMappingURL=chunk-MN3LHRGV.cjs.map
|
|
8012
|
+
//# sourceMappingURL=chunk-MN3LHRGV.cjs.map
|