Count the number of words in the documents

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

    • documents: Document[]

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

    Returns WordScore

    A dictionary of words and their counts