mirror of
https://github.com/Brandon-Rozek/Rozbot.git
synced 2024-11-07 20:30:34 -05:00
10 lines
310 B
JavaScript
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();
|
|
});
|
|
}
|