Function snippetAround

  • A hit's snippet: the first word of the text that begins with one of the query's words (the lexical legs' prefix rule, on the words of the word rule, each word and query word compared in NFC and in lower case), and whole words around it; with no such word, the text's start. The offset is the text's own, read on the text as given, so a caller places the hit in its turns. before is 80 and after 120 unless given.

    Parameters

    • text: string
    • words: readonly string[]
    • options: {
          before?: number;
          after?: number;
      } = {}
      • Optional before?: number
      • Optional after?: number

    Returns Snippet