From 3f8672553a2f43518e85acb3b9b9afb16597e145 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Thu, 4 Dec 2014 00:58:53 +0200 Subject: tab should not change node from last edit; now can tab when sentence is empty --- src/textanalysis.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/textanalysis.js') diff --git a/src/textanalysis.js b/src/textanalysis.js index 416106fc..44765916 100644 --- a/src/textanalysis.js +++ b/src/textanalysis.js @@ -217,6 +217,10 @@ var textAnalyser = function (newtext, finalize) { ret.link_set_add.push(link); } + if (newtext.indexOf('#') == -1 || finalize) { + lastnode = null; + } + //Sentence Sequencing //Build the words and cuts the main elements sentence = tokenize(newtext, '#', '"'); @@ -435,7 +439,11 @@ var textAnalyser = function (newtext, finalize) { if (true == finalize && node.state == 'temp') { console.log('bug: temp node creation on finalize'); } else { - lastnode = graph.addNode(node); + if (!finalize) { + lastnode = graph.addNode(node); + } else { + graph.addNode(node); + } } }); -- cgit v1.3.1