I would like to adjust the number of words that the word cloud accepts. I have a two part question.
After I parse the full text of a text file into javascript, if I wanted to limit the number of words that I feed into cloud.js to save on computational resources, how would I access a subset of the word_count object? I presume the word_count object has not been ordered by frequency before the cloud is called? I would like to select the top k of the word_count object, let's say the top 20 words. Can someone advise on what that entails?
If I wanted to instead limit the number of words the cloud.js accepts from the full parsed text file, is there anything built in that can do that? I didn't see anything like .maxwords(). Again, depending on when the word_count object is ordered from most frequent to least frequent, will have bearing on the words it needs.
As much of the algorithm is over my head, I don't want to end up editing at the wrong portion of the code and potentially confront the possibility of important/frequent/"unique" words that I'm mainly interested in being dropped out. That's why I prefer to first consult the existing expert community here.
I would like to adjust the number of words that the word cloud accepts. I have a two part question.
After I parse the full text of a text file into javascript, if I wanted to limit the number of words that I feed into cloud.js to save on computational resources, how would I access a subset of the word_count object? I presume the word_count object has not been ordered by frequency before the cloud is called? I would like to select the top k of the word_count object, let's say the top 20 words. Can someone advise on what that entails?
If I wanted to instead limit the number of words the cloud.js accepts from the full parsed text file, is there anything built in that can do that? I didn't see anything like .maxwords(). Again, depending on when the word_count object is ordered from most frequent to least frequent, will have bearing on the words it needs.
As much of the algorithm is over my head, I don't want to end up editing at the wrong portion of the code and potentially confront the possibility of important/frequent/"unique" words that I'm mainly interested in being dropped out. That's why I prefer to first consult the existing expert community here.
Please advise,
Thank you