diff options
| author | Alon Levy <alon@pobox.com> | 2014-09-21 19:11:14 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-09-21 19:11:14 +0300 |
| commit | 810f2951b50357bcb6b854da312027d64fcddb25 (patch) | |
| tree | 02c03da06e04897208aacba69729bad90093525f /scripts/rhizicore.js | |
| parent | 15eb20c94c8143d84cb0c26fa5ae57a2a7b864c0 (diff) | |
Fixes #41: conjugation/connector only sentences keep their links
Diffstat (limited to 'scripts/rhizicore.js')
| -rw-r--r-- | scripts/rhizicore.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js index d90daac9..670ed7bb 100644 --- a/scripts/rhizicore.js +++ b/scripts/rhizicore.js @@ -186,14 +186,16 @@ function myGraph(el) { } } - this.addLink = function(sourceId, targetId, name, state) { + this.addLink = function(sourceId, targetId, name, state, drop_conjugator_links) { sourceId = sourceId && sourceId.toLowerCase(); targetId = targetId && targetId.toLowerCase(); var sourceNode = findNode(sourceId, null); var targetNode = findNode(targetId, null); var found = findLink(sourceId,targetId,name); - - if(name)if(name.replace(/ /g,"")==="and")state="temp"; + + if (drop_conjugator_links && name && (name.replace(/ /g,"") === "and")) { + state = "temp"; + } if(!found && ((sourceNode !== undefined) && (targetNode !== undefined))) { var link = { "source": sourceNode, |
