Exemplo n.º 1
0
function featureExtractor($tweet)
{
    $tweet = removeUrlAndUserNames($tweet);
    $tweet = replaceEmoticons($tweet);
    $tweet = changeCase($tweet);
    $tweet = separateWords($tweet);
    $tweet = stripSpecialChar($tweet);
    $tweet = removeEmptyWords($tweet);
    $tweet = removeStopWords($tweet);
    $tweet = replaceMultiLetterSpelling($tweet);
    $tweet = applyPorterStemming($tweet);
    return $tweet;
}
Exemplo n.º 2
0
                 $entireWebresults = "Sorry, no results matching {$search}";
             }
             $blekko = searchBlekko($search);
             if ($blekko == false) {
                 $blekkoresults = "Sorry, no results matching {$search}";
             }
             $google = scrapeGoogle(urlencode($search));
             if ($google == false) {
                 $googleresults = "Sorry, no results matching {$search}";
             }
         }
     }
 } else {
     if ($radioGroup2 == 'stemmingOn') {
         // Remove stopwords and apply stemming
         $stemsUnique = applyPorterStemming($searchExploded);
         $search = implode(" ", $stemsUnique);
         $bing = searchBing($search);
         if ($bing == false) {
             $bingresults = "Sorry, no results matching {$search}";
         }
         $entireWeb = searchEntireWeb($search);
         if ($entireWeb == false) {
             $entireWebresults = "Sorry, no results matching {$search}";
         }
         $blekko = searchBlekko($search);
         if ($blekko == false) {
             $blekkoresults = "Sorry, no results matching {$search}";
         }
         $google = scrapeGoogle(urlencode($search));
         if ($google == false) {