@willwade/aac-processors
    Preparing search index...

    Function createWordlist

    • Creates a WordList object from an array of words/phrases or a dictionary

      Parameters

      • input: string[] | WordListItem[] | Record<string, string | WordListItem>

        Either an array of strings or an object with text/image/partOfSpeech properties

      Returns WordList

      A WordList object ready to be used in Grid3

      // From simple array
      const wordlist = createWordlist(['hello', 'goodbye', 'thank you']);
      // From array of objects
      const wordlist = createWordlist([
      { text: 'hello', image: '[WIDGIT]greetings/hello.emf', partOfSpeech: 'Interjection' },
      { text: 'goodbye', image: '[WIDGIT]greetings/goodbye.emf', partOfSpeech: 'Interjection' }
      ]);