From: <sk...@us...> - 2008-10-23 07:41:08
|
Revision: 1414 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1414&view=rev Author: sknappe Date: 2008-10-23 07:41:02 +0000 (Thu, 23 Oct 2008) Log Message: ----------- no learning, if there is no change in examples Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_article.php trunk/src/dbpedia-navigator/js/ajax.js Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-23 07:30:04 UTC (rev 1413) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-23 07:41:02 UTC (rev 1414) @@ -362,19 +362,24 @@ $_SESSION['nextArticle']++; //Add Positives to Session + $noChange="false"; if (!isset($_SESSION['positive'])){ $array=array($uri => $artTitle); $_SESSION['positive']=$array; } else{ $array=$_SESSION['positive']; - $array[$uri]=$artTitle; - if (count($array)>10){ - foreach ($array as $key=>$value){ - unset($array[$key]); - break; + if (!isset($array[$uri])){ + $array[$uri]=$artTitle; + if (count($array)>10){ + foreach ($array as $key=>$value){ + unset($array[$key]); + break; + } } } + else + $noChange="true"; $_SESSION['positive']=$array; } @@ -393,19 +398,24 @@ $uri=$_SESSION['articles'][$fromCache]['uri']; //Add Positives to Session + $noChange="false"; if (!isset($_SESSION['positive'])){ $array=array($uri => $artTitle); $_SESSION['positive']=$array; } else{ $array=$_SESSION['positive']; - $array[$uri]=$artTitle; - if (count($array)>10){ - foreach ($array as $key=>$value){ - unset($array[$key]); - break; + if (!isset($array[$uri])){ + $array[$uri]=$artTitle; + if (count($array)>10){ + foreach ($array as $key=>$value){ + unset($array[$key]); + break; + } } } + else + $noChange="true"; $_SESSION['positive']=$array; } } @@ -431,6 +441,8 @@ print '$$$'; print $interests[1]; print '$$$'; + print $noChange; + print '$$$'; print $lat; print '$$$'; print $long; Modified: trunk/src/dbpedia-navigator/js/ajax.js =================================================================== --- trunk/src/dbpedia-navigator/js/ajax.js 2008-10-23 07:30:04 UTC (rev 1413) +++ trunk/src/dbpedia-navigator/js/ajax.js 2008-10-23 07:41:02 UTC (rev 1414) @@ -59,10 +59,10 @@ document.getElementById('lastarticles').innerHTML=response[2]; document.getElementById('Positives').innerHTML=response[3]; document.getElementById('Negatives').innerHTML=response[4]; - if (response[5].length>0&&response[6].length>0) - loadGoogleMap(response[5],response[6],''+response[1]); + if (response[6].length>0&&response[7].length>0) + loadGoogleMap(response[6],response[7],''+response[1]); document.getElementById('LastArticlesBox').style.display='block'; - learnConcept(); + if (response[5]=="false") learnConcept(); }else setTimeout("search_it('label='+document.getElementById('label').value+'&number=10')",2000); generateURL(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |