diff options
| author | Owen <despito@MacBook-Pro-de-Despito.local> | 2014-08-07 15:22:31 +0300 |
|---|---|---|
| committer | Owen <despito@MacBook-Pro-de-Despito.local> | 2014-08-07 15:22:41 +0300 |
| commit | 038e4ed146e5a29933cc8dc34004f0962d1c9987 (patch) | |
| tree | 586a516cd52897f8fe239f699796af81c40a2430 /scripts/textanalysis.js | |
| parent | bf2f0bf85ff9cc287b69fa8a2a67e735ffee130b (diff) | |
Issue #26
nodes didn't appear because the type selection index was undefined in
the 0 to N_1 loop
Diffstat (limited to 'scripts/textanalysis.js')
| -rw-r--r-- | scripts/textanalysis.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index cde4c937..77c158be 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -225,6 +225,9 @@ function TextAnalyser2(newtext, finalize) { //0-N ORDER STACK for (var m = 0; m < orderStack.length - 1; m++) { switch (orderStack[m]) { + case "START": + if(!typeStack[nodeindex])typeStack[nodeindex]=nodetypes[typeindex]; + break; case "NODE": graph.addNode(newnodes[nodeindex], typeStack[nodeindex], typesetter); if (!abnormalGraph) graph.addLink(newnodes[nodeindex - 1], newnodes[nodeindex], newlinks[linkindex], typesetter); @@ -254,7 +257,7 @@ function TextAnalyser2(newtext, finalize) { case "LINK": linkindex++; graph.addNode("new node", "empty", "temp"); - if (!abnormalGraph) graph.addLink(newnodes[nodeindex - 1], "new node", newlinks[linkindex], "temp"); + if (!abnormalGraph)graph.addLink(newnodes[nodeindex - 1], "new node", newlinks[linkindex], "temp"); ANDcase = ANDconnect("new node"); break; } @@ -265,12 +268,17 @@ function TextAnalyser2(newtext, finalize) { if (newnodes[nodeindex - 2]) if (newlinks[linkindex - 1].replace(/ /g, "") == "and" && newlinks[linkindex].replace(/ /g, "") !== "and") { if (!abnormalGraph) - if(finalize)graph.addLink(newnodes[nodeindex - 2], node, newlinks[linkindex], typesetter); + //if(finalize)graph.addLink(newnodes[nodeindex - 2], node, newlinks[linkindex], typesetter); + if(finalize)graph.editLink(newnodes[nodeindex - 2], newnodes[nodeindex - 1], completeSentence); else graph.addLink(newnodes[nodeindex - 2], node, newlinks[linkindex], "temp"); return true; } } + console.log(sentence); + console.log(completeSentence); + console.log(orderStack); + //STAR CASE var verb = ""; if (abnormalGraph) { |
