(tokens: string, word: string)
| 244 | |
| 245 | // Get the weighting of a word in a string based on its position |
| 246 | const getWeighting = (tokens: string, word: string) => { |
| 247 | const length = tokens.length; |
| 248 | const position = tokens.indexOf(word); |
| 249 | return position === -1 ? 0 : (length - position) / length; |
| 250 | }; |
no outgoing calls
no test coverage detected
searching dependent graphs…