Skip to content
Snippets Groups Projects
Commit 0aeaa337 authored by alvaro's avatar alvaro
Browse files

Added stopwords for wordcloud filter

parent 067f9857
No related branches found
No related tags found
No related merge requests found
......@@ -54,18 +54,21 @@ function D3WordCloud'.$randId.'(words, newcfg){
var cfg = {width: 300,
height: 300,
font: "sans-serif",
color: "black"
color: "black",
stopwords: ["of", "the", "a", "or", "to", "and", "for", "at", "with", "without"]
};
for(i in newcfg){
cfg[i] = newcfg[i];
}
var countingWords = {};
for(i in words){
var d = words[i];
if(countingWords[d] != undefined){
countingWords[d] += 1
}else{
countingWords[d] = 1
var d = words[i].replace(/\)\(\./gi, "");
if(cfg.stopwords.indexOf(d)<0){
if(countingWords[d] != undefined){
countingWords[d] += 1
}else{
countingWords[d] = 1
}
}
}
var totalWords = new Array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment