Interface Snippet

Where a query's words first begin a word of a text, and the text around that place, for a search hit.

interface Snippet {
    at: number;
    text: string;
}

Properties

Properties

at: number

Where in the text the first word that begins with a query word starts, or -1 when none does.

text: string

Whole words around that word, white space collapsed: from just after the last white space (a space, a tab or a line break) at or before before characters ahead of it (or from the text's start) to the first white space at or after after characters past its start (or to the text's end). A text with no white space, as Chinese and Japanese are written, comes back whole.