diff options
| author | Alon Levy <alon@pobox.com> | 2014-10-21 10:55:01 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-10-21 11:00:22 +0300 |
| commit | b8119bfb95550fdb9014df3a80791024a9923867 (patch) | |
| tree | a3f40e05216e14af0f61f4d67d7f62828eb133d3 | |
| parent | e91affbe18d1ac5cdbe202cc195b193505313338 (diff) | |
fix test_analyzer after require.js
| -rw-r--r-- | scripts/rhizicore.js | 1 | ||||
| -rw-r--r-- | scripts/textanalysis.ui.js | 2 | ||||
| -rw-r--r-- | tests/test_analyzer.js | 10 |
3 files changed, 8 insertions, 5 deletions
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js index c480e676..9c2d299f 100644 --- a/scripts/rhizicore.js +++ b/scripts/rhizicore.js @@ -1159,5 +1159,6 @@ function expand(obj){ return { expand: expand, graph: graph, + force: force, } }); /* close define call */ diff --git a/scripts/textanalysis.ui.js b/scripts/textanalysis.ui.js index 98d0fe83..0a1e3ece 100644 --- a/scripts/textanalysis.ui.js +++ b/scripts/textanalysis.ui.js @@ -3,7 +3,6 @@ var text = ""; // Last text of sentence var element_name = '#textanalyser'; var element = $(element_name); -// TODO - hide this in a scope function analyzeSentence(sentence, finalize) { var ret = textanalysis.textAnalyser2(sentence, finalize); @@ -60,6 +59,7 @@ function changeType(arg, id) { } return { + analyzeSentence: analyzeSentence, main:function () { if (element.length != 1) { return; diff --git a/tests/test_analyzer.js b/tests/test_analyzer.js index d003f8f6..bd74429b 100644 --- a/tests/test_analyzer.js +++ b/tests/test_analyzer.js @@ -18,15 +18,17 @@ I like to work with #a base.run_tests({ done: function (errors, window) { debugger; - if (process.argv.length > 2) { - window.analyzeSentence(process.argv.slice(2).join(" "), true); - dump_graphviz(window); + var analyzeSentence = window.require('textanalysis.ui').analyzeSentence; + console.log(process.argv); + if (process.argv.length >= 2) { + analyzeSentence(process.argv.slice(2).join(" "), true); + base.dump_graphviz(window.require('rhizicore').force); } else { for (var k in data) { var sentence = data[k][0]; var expected_nodes = data[k][1]; var expected_links = data[k][2]; - window.analyzeSentence(sentence, true); + analyzeSentence(sentence, true); // TODO - compare graphs } } |
