UNPKG

fiction-word

Version:
11 lines (10 loc) 424 B
/** * @description Computes the cumulative distribution of word lengths. * @returns An array of cumulative probabilities for each word length. */ export declare function generateDistribution(mode?: "dictionary" | "corpus"): [number, number][]; /** * Sample a word length from the distribution. * @returns A random word length. */ export declare function getRandomWordLength(distribution?: [number, number][]): number;