示例#1
0
<?php

include_once '../../inc/config.inc.php';
include_once 'aggregator.php';
$agg = new aggregator();
$agg->aggregateAllBlogs(isset($argv[1]) ? $argv[1] : null);
示例#2
0
 for ($i = 0; $i < ($_SESSION['results'] > 50 ? 2 : 1); $i++) {
     // Get offset
     $offset = 1 + $i * 50;
     // Call Bing API
     $api1->bingApi($query2, $_SESSION['results'], $offset);
     // Set BING JSON Data
     $formatter1->setBingJson($api1->returnBingJsonData(), $api1->returnBingJsonResultFlag());
     $formatter1->formatBingJson($_SESSION['results'], $i * 50);
 }
 // Blekko Results
 $api1->blekkoApi($query3, $_SESSION['results'], 0);
 // Set BLEKKO JSON Data
 $formatter1->setBlekkoJson($api1->returnBlekkoJsonData(), $api1->returnBlekkoJsonResultFlag());
 $formatter1->formatBlekkoJson($_SESSION['results'], 0);
 // Instantate Aggregator
 $aggregator1 = new aggregator(new resultSet());
 // Send result sets 1,2 & 3 to Data Fusion Function
 $aggregator1->dataFusion($api1->returnGoogleJsonResultFlag(), $api1->returnBingJsonResultFlag(), $api1->returnBlekkoJsonResultFlag(), $formatter1->returnResultSet('resultSet1'), $formatter1->returnResultSet('resultSet2'), $formatter1->returnResultSet('resultSet3'));
 // Instantiate Cluster Object
 $cluster1 = new cluster();
 // Instantiate Stopword Dictionary
 $stopwordDictionary = new dictionary('stop-words-english2-short.txt');
 //$stopwordDictionary->loadStopwordFile();
 // Add Query to Stopwords
 $stopwordDictionary->addQueryToStopwords($cluster1->tokeniseString($q));
 $stopwords = $stopwordDictionary->returnStopwords();
 // Find the cluster terms of interest
 $cluster1->findBinaTerms($aggregator1->returnResultSetAggSnippets());
 // Count Term Freq
 //$cluster1->countTermFrequency($aggTitles);
 //$cluster1->countTermFrequency($aggregator1->returnResultSetAggSnippets());