(text: string)
| 44 | |
| 45 | /** a text's terms, split as MiniSearch's tokenizer splits them */ |
| 46 | const termsOf = (text: string) => |
| 47 | text |
| 48 | .split(/[\n\r\p{Z}\p{P}]+/u) |
| 49 | .filter(Boolean) |
| 50 | .map(fold) |
| 51 | |
| 52 | const compact = (text: string) => text.replaceAll(/[\s-]/g, "") |
| 53 |