diff --git a/lib/Haanga/lib/Haanga/Extension/Filter/D3wordcloud.php b/lib/Haanga/lib/Haanga/Extension/Filter/D3wordcloud.php index 4d96dfccf4f7e908c98bdf03785ebde34c7098fa..632906a9268ec0a6ef09b8d3f5cbd77a08cd8c09 100644 --- a/lib/Haanga/lib/Haanga/Extension/Filter/D3wordcloud.php +++ b/lib/Haanga/lib/Haanga/Extension/Filter/D3wordcloud.php @@ -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();