var wordInDoc = {};
var cekwordInDoc = function(word, _class, delta){
if (arguments.length < 3) delta = 1
if (!(word in wordInDoc)) wordInDoc[word] = 0
wordInDoc[_class]._class[word] += delta
sumDocs += delta
return this
}
from that code i want to collect all word and set into wordInDoc object example cekwordInDoc('good', 'positif', 1) and i want save to object
wordInDoc = {
positif: {
wd: ['good : 1', 'love : 1']
},
negatif: {
wd: ['lee : 1', 'fuk : 1']
}
};
i hope anyone can help me for this problem, i tried.
via kellenkzedenk
No comments:
Post a Comment