summaryrefslogtreecommitdiff
path: root/src/client/textanalysis.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-01-06 21:42:22 +0200
committerAlon Levy <alon@pobox.com>2015-01-06 21:42:22 +0200
commit8a276a3e94f3a6227e766b41e94119e0001ab5bc (patch)
tree6ec97819aeb428ef583f753e8fbabc52265c568e /src/client/textanalysis.js
parentbb5bd7f158dc791d16cde816fa25dd0dd7f62ac4 (diff)
client/analyzeSentence: use spec
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');