Example #1
0
} else {
    $current_word = -1;
}
if (isset($_POST['offset_match']) && is_numeric($_POST['offset_match'])) {
    $offset_match = $_POST['offset_match'];
} else {
    $offset_match = 0;
}
// Restart the spell check
if (isset($_POST['restart'])) {
    $current_word = -1;
    $offset_match = 0;
    $t_ignored_words = array();
}
// New instance of the dictionary
$dictionary = new dictionary();
// Check it's installed
if (!$dictionary->is_installed()) {
    html_draw_error(gettext("No dictionary has been installed. Please contact the forum owner to remedy this."));
}
// Initialise it
$dictionary->initialise($t_content, $t_ignored_words, $current_word, $obj_id, $offset_match);
// Check for submit
if (isset($_POST['ignoreall'])) {
    // User wants to ignore all references to the current word
    $dictionary->add_ignored_word($dictionary->get_current_word());
    $dictionary->find_next_word();
} else {
    if (isset($_POST['add'])) {
        // User wants to add the current word to his dictionary
        if (isset($_POST['word']) && strlen(trim($_POST['word'])) > 0) {
<?php

include "dictionary_function.php";
class dictionary
{
    public $str1 = "";
    public $str2 = "";
    function setDic($str1, $str2)
    {
        $result = dictionary($str1, $str2);
        $this->str1 = $str1;
        $this->str2 = $str2;
        return $result;
    }
}
$dicshow = new dictionary();
echo $dicshow->setDic("def", "abc");
Example #3
0
     $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());
 // Set most frequet terms
 //$cluster1->setMostFrequentTerms(10);
 //$cluster1->stopwordRemoval($stopwords);
 //echo $cluster1->countClusteredTerms();
 //$cluster1->displayClusteredTerms();
 $cluster1->setDocumentBinatures($aggregator1->returnResultSetAggSnippets());