@untemps/utils - v3.1.0
    Preparing search index...

    Function generateTokenizedText

    • Parameters

      Returns { indices: number[]; text: string }

      An object containing a list of token indices and the generated string.

      import { generateTokenizedText } from '@untemps/utils/string/generateTokenizedText'

      const tokens = ['pol', 'biz', 'kuy']
      const divider = '$'
      const minWords = 5
      const maxWords = 10
      const dictionary = ['foo', 'bar', 'gag']
      generateTokenizedText(tokens, divider, minWords, maxWords, dictionary) // {indices: Array(3), text: "foo $pol$ $biz$ bar gag $kuy$ foo gag foo"}}