UNPKG

word-frequency-counter

Version:
19 lines (18 loc) 650 B
import { Config } from "../../config"; type WordMap = Map<string, number>; /** * Count instances of a given word in a block of text. * * @param {string} text - The text to parse. * @param {string} word - The word to count. * @param {Config} config - Configuration for the word counter */ export declare const singleWordCount: (text: string, word: string, config?: Config) => number; /** * Count instances of all words in a block of text. * * @param {string} text - The text to parse. * @param {Config} config - Configuration for the word counter */ export declare const allWordCount: (text: string, config?: Config) => WordMap; export {};