Utterance
Defined in: core/src/nlp/utterance/utterance.instance.ts:6
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Utterance(parts): Utterance;Defined in: core/src/nlp/utterance/utterance.instance.ts:10
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
parts |
readonly UtterancePart[] |
Returns
Section titled “Returns”Utterance
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get parts(): readonly UtterancePart[];Defined in: core/src/nlp/utterance/utterance.instance.ts:16
The template, alternating literal text and slots, in source order.
Returns
Section titled “Returns”readonly UtterancePart[]
Get Signature
Section titled “Get Signature”get slots(): readonly SlotRef[];Defined in: core/src/nlp/utterance/utterance.instance.ts:26
The slots this utterance interpolates, in source order.
May repeat: one slot can appear at several positions, and an engine reports every extraction for it rather than picking one.
Returns
Section titled “Returns”readonly SlotRef[]
Methods
Section titled “Methods”render()
Section titled “render()”render(placeholder): string;Defined in: core/src/nlp/utterance/utterance.instance.ts:37
Renders the template with each slot replaced by placeholder(ref).
An engine’s own placeholder syntax is its business — nlp.js wants %name%,
something else may want {name} — so the shape is the caller’s to choose and
nothing engine-specific reaches this package.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
placeholder |
(ref) => string |
Returns
Section titled “Returns”string