Skip to content

Instantly share code, notes, and snippets.

View StephMansour's full-sized avatar

Stephane Mansour StephMansour

View GitHub Profile
BM25.Tokenize = function(text) {
text = text
.toLowerCase()
.replace(/\W/g, ' ')
.replace(/\s+/g, ' ')
.trim()
.split(' ')
.map(function(a) { return stemmer(a); });
// Filter out stopStems