MCPcopy Create free account
hub / github.com/codemix/graph / generateDocument

Function generateDocument

packages/text-search/src/performance.test.ts:9–329  ·  view source on GitHub ↗

* Generate a realistic document with the specified word count. * Uses a mix of common words and technical terms.

(wordCount: number, seed: number = 0)

Source from the content-addressed store, hash-verified

7 * Uses a mix of common words and technical terms.
8 */
9function generateDocument(wordCount: number, seed: number = 0): string {
10 const commonWords = [
11 "the",
12 "a",
13 "an",
14 "is",
15 "are",
16 "was",
17 "were",
18 "be",
19 "been",
20 "being",
21 "have",
22 "has",
23 "had",
24 "do",
25 "does",
26 "did",
27 "will",
28 "would",
29 "could",
30 "should",
31 "may",
32 "might",
33 "must",
34 "shall",
35 "can",
36 "need",
37 "dare",
38 "ought",
39 "used",
40 "to",
41 "of",
42 "in",
43 "for",
44 "on",
45 "with",
46 "at",
47 "by",
48 "from",
49 "up",
50 "about",
51 "into",
52 "over",
53 "after",
54 "beneath",
55 "under",
56 "above",
57 "and",
58 "but",
59 "or",
60 "as",
61 "if",
62 "when",
63 "than",
64 "because",
65 "while",
66 "although",

Callers 2

Calls 3

nextRandomFunction · 0.85
pushMethod · 0.45
endsWithMethod · 0.45

Tested by

no test coverage detected