From 810f2951b50357bcb6b854da312027d64fcddb25 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 21 Sep 2014 19:11:14 +0300 Subject: Fixes #41: conjugation/connector only sentences keep their links --- scripts/rhizicore.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts/rhizicore.js') 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, -- cgit v1.3.1