Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

tokenize javascript

var text = "This is a short text about StackOverflow.";
var stopwords = ['this'];

var words = text.split(/W+/).filter(function(token) {
    token = token.toLowerCase();
    return token.length >= 2 && stopwords.indexOf(token) == -1;
});

console.log(words); // ["is", "short", "text", "about", "StackOverflow"]
 
PREVIOUS NEXT
Tagged: #tokenize #javascript
ADD COMMENT
Topic
Name
5+3 =