π’Frequency Functions
A pair of functions to efficiently calculate and retrieve the frequency of words and characters in a given text, providing useful insights for text analysis and processing tasks.
Table of Contents
wordFrequency
javascriptCopy codeconst text = "This is a sample text. This text is just a sample.";
const wordFreq = wordFrequency(text, 3);
console.log(wordFreq); // Output: Map { 'This' => 2, 'is' => 2, 'a' => 2 }charFrequency
Last updated