summaryrefslogtreecommitdiff
path: root/src/client/textanalysis.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/textanalysis.js')
-rw-r--r--src/client/textanalysis.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/textanalysis.js b/src/client/textanalysis.js
index 67778b81..12e6e0de 100644
--- a/src/client/textanalysis.js
+++ b/src/client/textanalysis.js
@@ -179,8 +179,11 @@ function tokenize(text, node_token, quote)
* marks).
*
*/
-var textAnalyser = function (newtext, finalize) {
- var sentence,
+var textAnalyser = function (spec) {
+ var newtext = spec.sentence,
+ finalize = spec.finalize,
+ cursor = spec.cursor,
+ sentence,
token_set_new_node_names = [], // token set representing new node names
token_set_new_link_names = [], // token set representing new link names
linkindex = 0,
@@ -204,6 +207,11 @@ var textAnalyser = function (newtext, finalize) {
links = [],
ret = model_diff.new_topo_diff();
+ util.assert(spec.sentence !== undefined &&
+ spec.finalize !== undefined &&
+ spec.cursor !== undefined,
+ "bad input");
+
function __addNode(name, type) {
if (type === undefined) {
console.log('bug: textanalyser.addNode of type undefined');