Documentation
    Preparing search index...

    Variable wordCountConst

    wordCount: (documents: Document[]) => WordScore

    Count the number of words in the documents

    Type declaration

      • (documents: Document[]): WordScore
      • Parameters

        • documents: Document[]

          The documents to count words from (array of arrays of words)

        Returns WordScore

        A dictionary of words and their counts

    const documents = [
    ['a', 'b', 'c'],
    ['a', 'b', 'd'],
    ]
    const result = wordCount(documents)
    result // => { a: 2, b: 2, c: 1, d: 1 }