Exemplo n.º 1
0
$time_pre = microtime(true);
// Get the Query from User input
$q = strtolower($_SESSION['query']);
if ($_SESSION['queryEx'] == 'on') {
    // Query Preprocess
    $thesaurus1 = new thesaurus();
    $thesaurus1->loadThesaurusFile($_SESSION['thesaurus']);
    $qX = new query();
    if ($_SESSION['stemmer'] == 'off') {
        $qX->tokeniseQuery($q);
    } else {
        if ($_SESSION['stemmer'] == 'on') {
            $qX->tokeniseQuery(implode(" ", $qX->stem_list($q)));
        }
    }
    $q = $qX->expandQuery($q, $thesaurus1->returnThesaurus());
}
// Process the Query
$q1 = new query();
$query1 = $q1->complexQueryGoogle($q);
$query2 = $q1->complexQueryBing($q);
$query3 = $q1->complexQueryBlekko($q);
// AGG
if ($_SESSION['result_op'] == 'agg') {
    // Instantiate a new API
    $api1 = new api();
    // Instantiate a new formatter with the 3 result sets as properties
    $formatter1 = new formatter(new resultSet(), new resultSet(), new resultSet());
    // Google Results
    for ($i = 0; $i < $_SESSION['results'] / 10; $i++) {
        // Get offset