From 6f30dfaab7a3b97d87067af5fdc3c2b390b8e2e9 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 7 Oct 2014 21:43:32 +0300 Subject: Fixes #49: forgot link changes --- scripts/textanalysis.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts/textanalysis.js') diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index 74b029ae..5003b110 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -325,11 +325,16 @@ var textAnalyser2 = function (newtext, finalize) { return [link.sourceId.toLowerCase(), link.targetId.toLowerCase()]; } )); - var k, n; + var k, n, l; if (comp.graph_same && !finalize) { + console.log('same graph, changing graph just a bit'); if (comp.old_id && comp.new_id) { graph.editName(comp.old_id, null, comp.new_id); } + for (k in ret.links) { + l = ret.links[k]; + graph.addLink(l.sourceId, l.targetId, l.name, l.state, ret.drop_conjugator_links); + } } else { //REINITIALISE GRAPH (DUMB BUT IT WORKS) graph.removeNodes("temp"); @@ -339,7 +344,7 @@ var textAnalyser2 = function (newtext, finalize) { graph.addNode(n.id, n.type, n.state); } for (k in ret.links) { - var l = ret.links[k]; + l = ret.links[k]; graph.addLink(l.sourceId, l.targetId, l.name, l.state, ret.drop_conjugator_links); } } -- cgit v1.3.1