diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-03 10:00:47 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-03 10:00:47 +0200 |
| commit | 719fe131138c4bc78264c6fc8bdbc2cd05cca06d (patch) | |
| tree | 5e0ac963093bc32859ea6219caa2430b45e30a69 /src | |
| parent | 13be74ac214d6a44cccb585db5ab41db767480b9 (diff) | |
textanalysis: fix multiple same names in sentence (a q b q c a => triangle)
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/textanalysis.js | 8 |
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) { |
