diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-01 00:09:32 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-01 00:09:32 +0200 |
| commit | 21e931e964079de1a6b686399b25e0f2f61db491 (patch) | |
| tree | 3443378cd445f5eaa324367249bccedaaeb34644 /src/client/textanalysis.js | |
| parent | c36e9bb38a5b92ce92924f8e2b342d2c2f1b16a4 (diff) | |
client/text_analysis: provide function to retrieve existing_nodes
Diffstat (limited to 'src/client/textanalysis.js')
| -rw-r--r-- | src/client/textanalysis.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/textanalysis.js b/src/client/textanalysis.js index 5855ae31..c4f5053f 100644 --- a/src/client/textanalysis.js +++ b/src/client/textanalysis.js @@ -502,6 +502,11 @@ var textAnalyser = function (spec) { // textanalysis.ui uses this. should make this more explicit ret.thirds = thirds; + ret.existing_nodes = function (main_graph) { + function not_null(x) { return x !== null; }; + return nodes.map(obj_take('name')).map(main_graph.find_node__by_name).filter(not_null); + } + ret.applyToGraph = function(spec) { var edit_graph = spec.edit_graph, backend_commit = spec.backend_commit, |
