|
|
@ -19143,7 +19143,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
words.forEach(function(w) {
|
|
|
|
words.forEach(function(w) {
|
|
|
|
var value = fdist[w];
|
|
|
|
var value = fdist[w];
|
|
|
|
if (value < maxSupport && value > maxc) {
|
|
|
|
if (value < maxSupport && value > maxc && (isNotRoot || stopwords.indexOf(itemset[w]) < 0)) {
|
|
|
|
maxw = +w;
|
|
|
|
maxw = +w;
|
|
|
|
maxc = value;
|
|
|
|
maxc = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -19185,7 +19185,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return { word: word, pos: pos, count: count, s0: s0, s1: s1 };
|
|
|
|
return { word: word, pos: pos, count: stopwords.indexOf(itemset[word]) < 0 ? count : minSupport, s0: s0, s1: s1 };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function expandSeqTree(rootSeq, graphs, expandCnt, minSupport, maxSupport, terms, itemset) {
|
|
|
|
function expandSeqTree(rootSeq, graphs, expandCnt, minSupport, maxSupport, terms, itemset) {
|
|
|
@ -19344,6 +19344,7 @@
|
|
|
|
var graphs = [];
|
|
|
|
var graphs = [];
|
|
|
|
var visibleGroups = expandSeqTree(this.rootSeq, graphs, DEFAULT_NODE_COUNT, minSupport, maxSupport, this.terms, itemset);
|
|
|
|
var visibleGroups = expandSeqTree(this.rootSeq, graphs, DEFAULT_NODE_COUNT, minSupport, maxSupport, this.terms, itemset);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.graphs = graphs.filter(function(g) {
|
|
|
|
this.graphs = graphs.filter(function(g) {
|
|
|
|
return g.nodes.length > 2;
|
|
|
|
return g.nodes.length > 2;
|
|
|
|
}).slice(0, 10);
|
|
|
|
}).slice(0, 10);
|
|
|
@ -19376,9 +19377,11 @@
|
|
|
|
key: 'getRenderedGraphs',
|
|
|
|
key: 'getRenderedGraphs',
|
|
|
|
value: function getRenderedGraphs(limit) {
|
|
|
|
value: function getRenderedGraphs(limit) {
|
|
|
|
var graphs = arguments.length === 1 ? this.graphs.slice(0, limit) : this.graphs;
|
|
|
|
var graphs = arguments.length === 1 ? this.graphs.slice(0, limit) : this.graphs;
|
|
|
|
|
|
|
|
console.log("slice")
|
|
|
|
var renderedGraphs = graphs.map(function(g) {
|
|
|
|
var renderedGraphs = graphs.map(function(g) {
|
|
|
|
return g.toRenderedGraph();
|
|
|
|
return g.toRenderedGraph();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log("toRenderedGraph")
|
|
|
|
var globalFreqRange = [(0, _lodash.min)(renderedGraphs.map(function(g) {
|
|
|
|
var globalFreqRange = [(0, _lodash.min)(renderedGraphs.map(function(g) {
|
|
|
|
return g.freqRange[0];
|
|
|
|
return g.freqRange[0];
|
|
|
|
})), (0, _lodash.max)(renderedGraphs.map(function(g) {
|
|
|
|
})), (0, _lodash.max)(renderedGraphs.map(function(g) {
|
|
|
@ -37424,7 +37427,6 @@
|
|
|
|
}).filter(function(entry) {
|
|
|
|
}).filter(function(entry) {
|
|
|
|
return entry.tokens.length > 0;
|
|
|
|
return entry.tokens.length > 0;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return new _TokenizedDataset2.default(tokenizedEntries);
|
|
|
|
return new _TokenizedDataset2.default(tokenizedEntries);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
@ -37855,13 +37857,18 @@
|
|
|
|
heap.push(n);
|
|
|
|
heap.push(n);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let counter = 1;
|
|
|
|
|
|
|
|
|
|
|
|
while (heap.size() > 0) {
|
|
|
|
while (heap.size() > 0) {
|
|
|
|
|
|
|
|
console.log(`in while ${counter++}`)
|
|
|
|
var parent = heap.pop();
|
|
|
|
var parent = heap.pop();
|
|
|
|
|
|
|
|
console.log(heap)
|
|
|
|
if (parent.merged) {
|
|
|
|
if (parent.merged) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var groups = [];
|
|
|
|
var groups = [];
|
|
|
|
|
|
|
|
console.log(parent.data.id)
|
|
|
|
if (parent.leftLinks.length > 1) {
|
|
|
|
if (parent.leftLinks.length > 1) {
|
|
|
|
var lNodes = parent.leftLinks.map(function(l) {
|
|
|
|
var lNodes = parent.leftLinks.map(function(l) {
|
|
|
|
return l.source;
|
|
|
|
return l.source;
|
|
|
@ -37875,6 +37882,7 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
groups = groups.concat(this.groupMergeableNodes(rNodes));
|
|
|
|
groups = groups.concat(this.groupMergeableNodes(rNodes));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(groups)
|
|
|
|
|
|
|
|
|
|
|
|
if (groups.length > 0) {
|
|
|
|
if (groups.length > 0) {
|
|
|
|
var newNodes = groups.map(function(group) {
|
|
|
|
var newNodes = groups.map(function(group) {
|
|
|
@ -38102,6 +38110,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
var RenderedGraph = function() {
|
|
|
|
var RenderedGraph = function() {
|
|
|
|
function RenderedGraph(rawGraph) {
|
|
|
|
function RenderedGraph(rawGraph) {
|
|
|
|
|
|
|
|
console.log(arguments)
|
|
|
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
|
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
|
|
_ref$bundle = _ref.bundle,
|
|
|
|
_ref$bundle = _ref.bundle,
|
|
|
|
bundle = _ref$bundle === undefined ? true : _ref$bundle,
|
|
|
|
bundle = _ref$bundle === undefined ? true : _ref$bundle,
|
|
|
@ -38134,8 +38143,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
this.assignNodeIds(nodes);
|
|
|
|
this.assignNodeIds(nodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(bundle)
|
|
|
|
if (bundle) {
|
|
|
|
if (bundle) {
|
|
|
|
var bundled = new _GraphBundler2.default(nodes, links).bundle();
|
|
|
|
var bundled = new _GraphBundler2.default(nodes, links).bundle();
|
|
|
|
|
|
|
|
console.log(bundled)
|
|
|
|
this.nodes = bundled.nodes;
|
|
|
|
this.nodes = bundled.nodes;
|
|
|
|
this.links = bundled.links;
|
|
|
|
this.links = bundled.links;
|
|
|
|
this.assignNodeIds(this.nodes);
|
|
|
|
this.assignNodeIds(this.nodes);
|
|
|
|