diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-07 08:45:58 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-07 15:02:42 +0200 |
| commit | 05a25ade0c19d6a221695d1ccb0ff07debfa9a05 (patch) | |
| tree | e9d6d4b969d253a12850fd965683792386c49c3d /src/client/textanalysis.js | |
| parent | 90c276f07f8c945eb16dc242af569ffd05f8b85e (diff) | |
client: return default node type to person
Diffstat (limited to 'src/client/textanalysis.js')
| -rw-r--r-- | src/client/textanalysis.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/textanalysis.js b/src/client/textanalysis.js index 3a89e51c..682b0b54 100644 --- a/src/client/textanalysis.js +++ b/src/client/textanalysis.js @@ -11,8 +11,11 @@ var separator_string = rz_config.separator_string; var typeindex = 0, nodetypes = model_types.nodetypes, + default_nodetype = 'person', node_name_to_type = {}; +util.assert(nodetypes.indexOf(default_nodetype) !== -1); + var _get_lastnode, get_lastnode = function (editgraph, cursor) { return undefined !== _get_lastnode ? _get_lastnode(editgraph, cursor) : null; @@ -376,7 +379,7 @@ var textAnalyser = function (spec) { if (name === NEW_NODE_NAME) { type = selectedType(); } else { - type = node_name_to_type[name] || nodetypes[0]; + type = node_name_to_type[name] || default_nodetype; } var node = { 'name': name, |
