Skip to content

FINANCE_PACKAGE

const FINANCE_PACKAGE: IEnginePackage;

Defined in: packages/engine/src/packages/finance/FinancePackage.ts:64

Money & finance phrase grammar: compound interest / investment growth, mortgage/loan repayment (standard amortization formula), sales tax/VAT add-and-remove, and CPI-based inflation-adjusted value. SoulverCore- inspired syntax where it could be confirmed (see each parselet’s doc comment for exact worked examples and any deliberate deviations); function-call forms (compoundInterest(...), monthlyPayment(...), taxAdd(...), inflationAdjust(...), …) are registered separately, in FUNCTION_PACKAGE’s shared FUNC dispatch (see packages/function/parselets/FunctionCallParselet.ts’s builtinNameToIndex map) rather than here.

TRIGGER-WORD COLLISION DESIGN NOTE (same regression class documented in MathPhrasesPackage.ts, and explicitly called out for this package up-front): “interest”, “tax”, “principal”, “payment”, “rate”, “balance”, “what”, “worth”, “value” are all common, plausible variable names, a shipped playground example already uses :tax (:total = :subtotal + :tax, see MathPhrasesPackage.ts’s doc comment). None of those words are bare keywords anywhere in this package. Every trigger is either:

  • a full phrase fused via phrases below (“interest on”, “tax on”, “monthly repayment on”, “what is”, “what was”, “value of”, “worth in”, …), so the leading word alone never becomes its own token type and stays usable as :interest/:tax/:what/:value/etc., or
  • a genuine preposition (“over”, “at”) with near-zero plausibility as a variable name, the same accepted-risk category as this codebase’s existing bare “between”/“from”/“next”/“last”/“best” keywords (see Token.ts’s OVER/RATE_AT doc comment).

Inflation-adjusted value (extends this package, see parselets/InflationQueryParselet.ts/InflationFutureValueParselet.ts/ InYearDollarsParselet.ts and data/CpiTable.ts for the bundled, clearly-labeled-approximate CPI-U table and its doc comment on vintage/accuracy) was the one topic explicitly deferred from this package’s original scope, now implemented.