diff options
| author | Alon Levy <alon@pobox.com> | 2014-12-04 00:58:53 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-04 01:20:18 +0200 |
| commit | 3f8672553a2f43518e85acb3b9b9afb16597e145 (patch) | |
| tree | 17b6eee37489349634bc3d63643e5bf42d2530fe /src/textanalysis.js | |
| parent | b624af90282eba635e140ab42eb5c4db17c0c921 (diff) | |
tab should not change node from last edit; now can tab when sentence is empty
Diffstat (limited to 'src/textanalysis.js')
| -rw-r--r-- | src/textanalysis.js | 10 |
1 files changed, 9 insertions, 1 deletions
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); + } } }); |
