(text: string)
| 73 | } |
| 74 | |
| 75 | function splitTerms(text: string): string[] { |
| 76 | return text |
| 77 | .replace(/([a-z])([A-Z])/g, "$1 $2") |
| 78 | .replace(/([A-Z])([A-Z][a-z])/g, "$1 $2") |
| 79 | .toLowerCase() |
| 80 | .split(/[^a-z0-9_]+/) |
| 81 | .filter((token) => token.length > 1); |
| 82 | } |
| 83 | |
| 84 | function cosine(a: number[], b: number[]): number { |
| 85 | let dot = 0; |
no outgoing calls
no test coverage detected