Skip to content

Utterance

Defined in: core/src/nlp/utterance/utterance.instance.ts:6

new Utterance(parts): Utterance;

Defined in: core/src/nlp/utterance/utterance.instance.ts:10

Parameter Type
parts readonly UtterancePart[]

Utterance

get parts(): readonly UtterancePart[];

Defined in: core/src/nlp/utterance/utterance.instance.ts:16

The template, alternating literal text and slots, in source order.

readonly UtterancePart[]


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.

readonly SlotRef[]

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.

Parameter Type
placeholder (ref) => string

string