summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2014-12-07 19:46:41 +0200
committerAlon Levy <alon@pobox.com>2014-12-16 10:59:14 +0200
commit651f5c29d25dc9caa24dc596919e62def6a2273e (patch)
treec2aa292038a33b8e321d91735af60b1dcbb28bd0
parent9d8a9524c33cafbf8525d3c0b901ae007dc05694 (diff)
removeNodes(): add filter param
-rw-r--r--src/model/graph.js5
-rw-r--r--src/textanalysis.js2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/model/graph.js b/src/model/graph.js
index abff1b2a..4db52d48 100644
--- a/src/model/graph.js
+++ b/src/model/graph.js
@@ -100,9 +100,8 @@ function Graph() {
this._remove_node_set([n]);
}
- this.removeNodes = function(state) {
- var id = null;
- var ns = findNodes(null, state);
+ this.removeNodes = function(n_filer) {
+ var ns = find_node_set_by_filer(n_filer);
this._remove_node_set(ns);
}
diff --git a/src/textanalysis.js b/src/textanalysis.js
index 1dee6ed6..6ecb8f72 100644
--- a/src/textanalysis.js
+++ b/src/textanalysis.js
@@ -404,7 +404,7 @@ var textAnalyser = function (newtext, finalize) {
});
} else {
// REINITIALISE GRAPH (DUMB BUT IT WORKS)
- graph.removeNodes("temp");
+ graph.removeNodes(function(n){ return "temp" == n.state; });
graph.removeLinks("temp");
ret.for_each_node_add(function (node) {