TokenFusion
Defined in: packages/engine/src/normalizer/NormalizerRule.ts:174
Record of a token fusion event performed by the normalizer.
When a rule merges multiple source tokens into fewer replacement tokens, the normalizer fires a fusion callback with this record. The playground uses these records to render the fusion detail table showing exactly which tokens were merged and by which rule.
Example
Section titled “Example”// "to" "the" "power" "of" fused into CARET "^"const fusion: TokenFusion = { rule: "phrase:to the power of", sourceTokens: [toToken, theToken, powerToken, ofToken], fusedToken: caretToken,};Properties
Section titled “Properties”fusedToken
Section titled “fusedToken”fusedToken: Token;Defined in: packages/engine/src/normalizer/NormalizerRule.ts:182
The resulting fused token with its new type and combined value
rule: string;Defined in: packages/engine/src/normalizer/NormalizerRule.ts:176
The name of the rule that triggered this fusion (e.g., “phrase:to the power of”)
sourceTokens
Section titled “sourceTokens”sourceTokens: Token[];Defined in: packages/engine/src/normalizer/NormalizerRule.ts:179
The original tokens before fusion, always ≥ 2 tokens