summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-03 10:00:47 +0200
committerAlon Levy <alon@pobox.com>2015-03-03 10:00:47 +0200
commit719fe131138c4bc78264c6fc8bdbc2cd05cca06d (patch)
tree5e0ac963093bc32859ea6219caa2430b45e30a69 /src/client
parent13be74ac214d6a44cccb585db5ab41db767480b9 (diff)
textanalysis: fix multiple same names in sentence (a q b q c a => triangle)
Diffstat (limited to 'src/client')
-rw-r--r--src/client/textanalysis.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/textanalysis.js b/src/client/textanalysis.js
index fe4b8891..1ab58497 100644
--- a/src/client/textanalysis.js
+++ b/src/client/textanalysis.js
@@ -363,6 +363,7 @@ var textAnalyser = function (spec) {
yell_bug = false, // TODO: fix both issues
node_by_name = lowerCaseHash(),
nodes = [],
+ nodes_set = {},
links = [],
ret = model_diff.new_topo_diff();
@@ -381,8 +382,11 @@ var textAnalyser = function (spec) {
'name': name,
'type': type,
};
- node_name_to_type[name] = type;
- nodes.push(node);
+ if (undefined === nodes_set[name]) {
+ node_name_to_type[name] = type;
+ nodes.push(node);
+ nodes_set[name] = true;
+ }
}
function __addLink(src_name, dst_name, name) {