UNPKG

retrieval

Version:

Full text search engine in js. Features BM25 ranking function that can be tuned.

11 lines (9 loc) 274 B
/** * Initialize sparse vector. * @exports {Function} that takes a length parameter, and then * makes a mathjs sparse zero vector of the specified length. */ const math = require('mathjs'); module.exports = function(len_) { return math.zeros(len_, 1, 'sparse'); };