(text: string)
| 35 | const tok_pat = /[a-z0-9]+/gi; |
| 36 | |
| 37 | export const tokenize = (text: string): string[] => { |
| 38 | const toks: string[] = []; |
| 39 | let m: RegExpExecArray | null; |
| 40 | while ((m = tok_pat.exec(text))) { |
| 41 | toks.push(m[0].toLowerCase()); |
| 42 | } |
| 43 | return toks; |
| 44 | }; |
| 45 | |
| 46 | const stem = (tok: string): string => { |
| 47 | if (tok.length <= 3) return tok; |
no outgoing calls
no test coverage detected