summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-10-26 21:14:08 +0200
committerAlon Levy <alon@pobox.com>2014-10-26 21:14:08 +0200
commit078b019b26c750fac166a8126193bf2580344f14 (patch)
treedfc6e6a74758e5c455bd915d8f24595c63291ce6 /scripts
parent20e29d4746f7926045da491e4c4ec3463dfdd737 (diff)
textanalysis (#86): make star case avoid an empty string that was causing a chainlink temp node created from ''
Diffstat (limited to 'scripts')
-rw-r--r--scripts/textanalysis.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js
index aa7d2e04..e61bad6d 100644
--- a/scripts/textanalysis.js
+++ b/scripts/textanalysis.js
@@ -236,7 +236,10 @@ var textAnalyser2 = function (newtext, finalize) {
}
}
- abnormalGraph = (newlinks.length - ANDcount) >= 3 || orderStack[orderStack.length - 1] != NODE;
+ abnormalGraph = (newlinks.length - ANDcount) >= 3 ||
+ ((newlinks.length - ANDcount >= 1) &&
+ orderStack.length > 1 &&
+ orderStack[orderStack.length - 1] != NODE);
//PREFIX not null case - put complete sentence in first link.
if (prefix && !abnormalGraph) {