diff options
| author | Alon Levy <alon@pobox.com> | 2014-08-19 19:05:08 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-08-19 19:05:12 +0300 |
| commit | fce7d7b7f8ee8a72537cc2ec8cd4acb16301cd95 (patch) | |
| tree | 6c30cfb9dd9ca31a0531f123c4066fd3c81f63a5 /scripts | |
| parent | 5e24dec2f65a75bdaca855e9595c08acfba6ca39 (diff) | |
textanalysis.js: some indentation and one if-bool rewrite
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/textanalysis.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index 168f2344..822e58aa 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -256,16 +256,19 @@ function TextAnalyser2(newtext, finalize) { graph.removeLinks("temp"); //ADD SURROUNDING BUBBLE - if (orderStack.length > 0) graph.addNode("", "bubble", "temp"); + if (orderStack.length > 0) { + graph.addNode("", "bubble", "temp"); + } - var abnormalGraph=false; - if((newlinks.length- ANDcount)>=3 )abnormalGraph=true; + var abnormalGraph = (newlinks.length - ANDcount) >= 3; //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]; + if (!typeStack[nodeindex]) { + typeStack[nodeindex] = nodetypes[typeindex]; + } break; case "NODE": graph.addNode(newnodes[nodeindex], typeStack[nodeindex], typesetter); @@ -292,8 +295,10 @@ function TextAnalyser2(newtext, finalize) { case "NODE": typeStack[nodeindex]=nodetypes[typeindex]; graph.addNode(newnodes[nodeindex], typeStack[nodeindex], typesetter); - if (!abnormalGraph){ graph.addLink(newnodes[nodeindex - 1], newnodes[nodeindex], newlinks[linkindex], typesetter); - ANDconnect(newnodes[nodeindex]);} + if (!abnormalGraph) { + graph.addLink(newnodes[nodeindex - 1], newnodes[nodeindex], newlinks[linkindex], typesetter); + ANDconnect(newnodes[nodeindex]); + } break; case "LINK": linkindex++; |
