(text: string)
| 12 | } |
| 13 | |
| 14 | const simple_vectorize = (text: string): number[] => { |
| 15 | const words = text.toLowerCase().split(/\W+/).filter(Boolean) |
| 16 | const vocab = Array.from(new Set(words)) |
| 17 | return vocab.map(word => words.filter(w => w === word).length / words.length) |
| 18 | } |
| 19 | |
| 20 | const remove_contradictory_statements = (steps: string[]): { cleaned: string[]; removed: number } => { |
| 21 | const cleaned: string[] = [] |