Rozbot/lib/helpers/grabTokens.js
2016-07-11 23:24:15 -04:00

10 lines
310 B
JavaScript

var stopWords = require('./stopWords.js');
module.exports = function(text) {
text = text || "";
return text.split(' ').filter(function(item) {
return stopWords.indexOf(item) === -1;
}).map(function(item) {
return (item.contains("http")) ? item: item.removeAll("?", ".", ",", "!").toLowerCase();
});
}