summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-09-21 14:17:11 +0300
committerAlon Levy <alon@pobox.com>2014-09-21 14:17:41 +0300
commit2dc0f0e2f2443d752c0b958f2fd58c49068b5314 (patch)
tree2fe055a26a919af412a80e67cd02102805ef2fbd /scripts
parent99ab703971fc013e3241dc3d8c462f7000a19ee9 (diff)
scripts/textanalysis.js cleanup: put switch & cases on same column
Diffstat (limited to 'scripts')
-rw-r--r--scripts/textanalysis.js58
1 files changed, 29 insertions, 29 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js
index 99c15861..3fe553da 100644
--- a/scripts/textanalysis.js
+++ b/scripts/textanalysis.js
@@ -64,37 +64,37 @@ function TextAnalyser2(newtext, finalize) {
//BUILD NEW NODE AND LINK ARRAYS WITH ORDER OF APPEARENCE
for (var m = 0; m < sentence.length; m++) {
switch (sentence[m]) {
- case "#":
- orderStack.push("START");
- break;
- case "and":
- case "+":
- case ",":
- case "&":
- sentence[m]=" and ";
- ANDcount++;
- //orderStack.push("AND");
- default:
- if (orderStack[orderStack.length - 1] === "START") {
- orderStack.push("NODE");
- newnodes.push(sentence[m]);
- linkindex++;
- } else if (orderStack[orderStack.length - 1] === "NODE") {
- orderStack.push("LINK");
- if (!newlinks[linkindex]) {
- newlinks[linkindex] = sentence[m] + " ";
- } else {
- newlinks[linkindex] += sentence[m] + " ";
- }
+ case "#":
+ orderStack.push("START");
+ break;
+ case "and":
+ case "+":
+ case ",":
+ case "&":
+ sentence[m]=" and ";
+ ANDcount++;
+ //orderStack.push("AND");
+ default:
+ if (orderStack[orderStack.length - 1] === "START") {
+ orderStack.push("NODE");
+ newnodes.push(sentence[m]);
+ linkindex++;
+ } else if (orderStack[orderStack.length - 1] === "NODE") {
+ orderStack.push("LINK");
+ if (!newlinks[linkindex]) {
+ newlinks[linkindex] = sentence[m] + " ";
} else {
- if (!newlinks[linkindex]) {
- newlinks[linkindex] = sentence[m] + " ";
- } else {
- newlinks[linkindex] += sentence[m] + " ";
- }
+ newlinks[linkindex] += sentence[m] + " ";
}
- if (newnodes.length === 0) prefix += sentence[m] + " ";
- break;
+ } else {
+ if (!newlinks[linkindex]) {
+ newlinks[linkindex] = sentence[m] + " ";
+ } else {
+ newlinks[linkindex] += sentence[m] + " ";
+ }
+ }
+ if (newnodes.length === 0) prefix += sentence[m] + " ";
+ break;
}
}