summaryrefslogtreecommitdiff
path: root/scripts/textanalysis.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-10-12 23:15:45 +0300
committerAlon Levy <alon@pobox.com>2014-10-12 23:15:45 +0300
commitc411b972445078cae539b743adda030e53a0a3b4 (patch)
tree18989d8426cbdf3bad0bc9dd95bec290b9dd5a0b /scripts/textanalysis.js
parentbbcc947ea7e7b610a770991b6366263acc15f78e (diff)
textanalysis: allow more than one letter changes between calls to textanalysis, firefox sometimes lags
Diffstat (limited to 'scripts/textanalysis.js')
-rw-r--r--scripts/textanalysis.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js
index e8781054..edd2a0d7 100644
--- a/scripts/textanalysis.js
+++ b/scripts/textanalysis.js
@@ -45,8 +45,9 @@ function up_to_two_renames(graph, old_id, new_id)
{
var not_one_letter = false;
var k;
- /* Includes:
- * single letter or no addition or removal after changing to lower case.
+ /* Allowed renames:
+ * no change
+ * s1 is substring of s2
* older (s1) node being 'new node'
*/
function allowed_rename(s1, s2)
@@ -55,8 +56,8 @@ function up_to_two_renames(graph, old_id, new_id)
s2 = s2.toLowerCase();
return (s1 == s2 ||
s1 == 'new node' ||
- (s1.length == s2.length + 1 && s1.substr(0, s2.length) == s2) ||
- (s2.length == s1.length + 1 && s2.substr(0, s1.length) == s1));
+ s1.substr(0, s2.length) == s2 ||
+ s2.substr(0, s1.length) == s1);
}
if (old_id.length != new_id.length) {