(text: string)
| 38 | const entries: SearchEntry[] = []; |
| 39 | |
| 40 | function tokenize(text: string): string[] { |
| 41 | return text |
| 42 | .toLowerCase() |
| 43 | .split(/\W+/) |
| 44 | .filter((t) => t.length >= 2); |
| 45 | } |
| 46 | |
| 47 | function addEntry(entry: SearchEntry): void { |
| 48 | const idx = entries.length; |