Pratheepan Raveendranathan > WebService-GoogleHack-0.03 > GoogleHack/GoogleHack.pm.save

Download:
WebService-GoogleHack-0.03.tar.gz

Annotate this POD

CPAN RT

New  1
Open  1
View Bugs
Report a bug
Source  

WebService::GoogleHack Package ^

SYNOPSIS ^

WebService::GoogleHack - Is a Perl package that interacts with the Google API, and has some basic functionalities that allow the user to interact with Googleand retrieve results. It also has some Natural Language Processing capabilities, such as the ability to predict the semantic orienation of words, build word clusters, find words that are common to a pair of words etc.

DESCRIPTION ^

This module acts as a driver module. Basically it acts as an interface between the user and the modules. The modules that are controlled by WebService::GoogleHack are:

WebService::GoogleHack::Text, Search, Rate, Spelling

AUTHOR ^

Pratheepan Raveendranathan, <rave0029@d.umn.edu>

Ted Pedersen, <tpederse@d.umn.edu>

BUGS ^

SEE ALSO ^

WebService::GoogleHack home page Pratheepan Raveendranathan Ted Pedersen

Google-Hack Maling List <google-hack-users@lists.sourceforge.net>

COPYRIGHT AND LICENSE ^

Copyright (c) 2003 by Pratheepan Raveendranathan, Ted Pedersen

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to

The Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

PACKAGE METHODS ^

__PACKAGE__->new(\%args)

Purpose: This function creates an object of type GoogleHack and returns a blessed reference.

__PACKAGE__->init(\%args)

Purpose: This this function can used to inititalize the member variables.

Valid arguments are :

__PACKAGE__->setMaxResults(\%args)

Purpose: This function sets the maximum number of results retrived

Valid arguments are :

__PACKAGE__->setlr(\%args)

Purpose: This this function can used to set the language restriction

Valid arguments are :

__PACKAGE__->setoe(\%args)

Purpose: This this function can used to set oe

Valid arguments are :

__PACKAGE__->setie(\%args)

Purpose: This this function can used to set ie

Valid arguments are :

__PACKAGE__->setStartPos(\%args)

Purpose: This function sets the startposition for the search results

Valid arguments are :

__PACKAGE__->setFilter(\%args)

Purpose: This functions sets the search filter as on or off

Valid arguments are :

__PACKAGE__->setRestrict(\%args)

Purpose: this funciton restricts the search to a specific domains

Valid arguments are :

__PACKAGE__->setSafeSearch(\%args)

Purpose: This functions enables safe search, Restricts search to non-abusive material.

Valid arguments are :

__PACKAGE__->measureSemanticRelatedness(\%args)

Purpose: this is function is used to measure the relatedness between two words it basically calls the measureSemanticRelatedness function which is in the Rate class

Valid arguments are :

Returns: Returns the object containing the PMI measure. ($search->{'PMI'}).

__PACKAGE__->predictSemanticOrientation(\%args)

Purpose: this function tries to predict the semantic orientation of a paragraph of text need

Valid arguments are :

Returns : the PMI measure and the prediction which is 0 or 1.

__PACKAGE__->phraseSpelling(\%args)

Purpose: This is function is used to retrieve a spelling suggestion from Google

Valid arguments are :

Returns: Returns suggested spelling if there is one, otherwise returns "No Spelling Suggested":

__PACKAGE__->Search(\%args)

Purpose: This function is used to query googles

Valid arguments are :

Returns: Returns a GoogleHack object containing the search results.

__PACKAGE__->initConfig(\%args)

Purpose: this function is used to read a configuration file containing informaiton such as the Google-API key, the words list etc.

Valid arguments are :

returns : Returns an object which contains the parsed information.

__PACKAGE__->printConfig(\%args)

Purpose: This function is used to print the information read from a configuration file

No arguments.

__PACKAGE__->getSearchSnippetWords(\%args)

Purpose: Given a search word, this function tries to retreive the text surrounding the search word in the retrieved snippets.

Valid arguments are :

returns : Returns an object which contains the parsed information

__PACKAGE__->getCachedSurroundingWords(\%args)

  Purpose:  Given a search word, this function tries to retreive the text 
surrounding the search word in the retrieved CACHED Web pages. It basically 
does the search and passes the search results to the 
WebService::GoogleHack::Text::getCachedSurroundingWords function.

Valid arguments are :

returns : Returns a hash with the keys being the words and the values being the frequency of occurence.

__PACKAGE__->getSearchSnippetSentences(\%args)

  Purpose:  Given a search word, this function tries to retreive the 
sentences in the snippet.It basically does the search and passes the 
search results to the WebService::GoogleHack::Text::getSnippetSentences 
function

Valid arguments are :

returns : Returns an array of strings.

__PACKAGE__->getCachedSurroundingSentences(\%args)

  Purpose:  Given a search word, this function tries to retreive the 
sentences in the cached web page.

Valid arguments are :

returns : Returns a hash which contains the parsed sentences as values and the key being the web URL.

__PACKAGE__->getSearchCommonWords(\%args)

  Purpose:Given two search words, this function tries to retreive the common 
text/words surrounding the search strings in the retrieved snippets.

Valid arguments are :

returns : Returns a hash which contains the parsed sentences as values and the key being the web URL.

__PACKAGE__->getWordClusters(\%args)

  Purpose:Given a search string, this function retreive the top frequency words
, and does a search on those words, and builds a list of words that can be 
regarded as a cluster of related words.

Valid arguments are :

returns : Returns a hash which contains the parsed sentences as values and the key being the web URL.

__PACKAGE__->getPairWordClusters(\%args)

  Purpose:Given two search strings, this function retreive the snippets for 
each string, and then finds the intersection of words, and then repeats the 
search with the intersection of words.

Valid arguments are :

returns : Returns a hash which contains the intersecting words as keys and the values being the frequency of occurence.

__PACKAGE__->getText(\%args)

  Purpose:Given a search string, this function will retreive the resulting 
URLs from Google, follow those links, and retrieve the text from there.  The 
function will then clean up the text and store it in a file along with the URL,
 Date and time of retrieval.The file will be stored under the name of the 
search string.

Valid arguments are :

returns : Returns nothing.