Meaning / Inspect several expressions

Inspect several expressions

Illuminate resolves explicitly selected expressions across a passage and returns the spans that an interface can highlight.

Choose the targets#

const result = await superb.illuminate({
  text: 'The bank approved the loan. We later walked along the river bank.',
  targets: ['bank'],
});

HTTP equivalent: POST /v1/illuminate. Supply 1–12 target expressions and at most 12,000 characters. The request supports up to 40 matched occurrences.

Render the spans#

Each span includes start and end as UTF-16 offsets into the original string. Use text.slice(start, end) to verify the highlighted text. The end is exclusive.

All occurrences share the same release identity within a request. unresolved records keep unknown or poorly supported readings visible; mismatches identify different contextual candidates for a repeated expression.

Avoid over-highlighting#

Choose expressions relevant to the person’s question. The current API requires explicit targets; it does not claim to identify every meaningful span automatically. Overlapping targets may produce overlapping ranges, so your renderer must decide how to display those without discarding the result.

Next: Integrate a product while preserving uncertainty and source information.