Rozbot/lib/helpers/grabTokens.js

11 lines
310 B
JavaScript
Raw Normal View History

2016-07-11 23:24:15 -04:00
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();
});
}