WLJS LogoWLJS Notebook

WordFrequency

WordFrequency[text, word] gives the frequency of word in text.

  • WordFrequency[text, {word1, word2, ...}] gives an association of the frequencies of each of the wordi.

This function calculates how often words appear in text as a fraction of total words.

Examples

WordFrequency["the cat and the dog", "the"]
WordFrequency[ExampleData[{"Text", "AliceInWonderland"}], "Alice"]
WordFrequency["hello world hello", {"hello", "world"}]

*See the official Wolfram Language Reference for more details.

On this page