RiTa
index
Name RiGoogler
Description A utility object for obtaining unigram, bigram, and weighted-bigram counts for words and phrases via the Google search engine.
      RiGoogler gp = new RiGoogler(this);
      float f = gp.getBigram("canid", "ski'd");
Constructors
RiGoogler(pApplet);
Methods
getBigram()   Returns the bigram coherence for the word pair where coherence(w1, w2) = bigram(w1 + w2)/(count(w1) + count(w2)) [from Gervas]

getBigramAvg()   Returns the avg value of all bigram pairs in the sentence.

getBigramMin()   Returns the min value of all bigram pairs in the sentence.

getCallCount()   Returns the number of live URL connections made by this object so far

getCount()   Returns the number of hits via Google for the search query.

getGoogleCookie()   Returns the last used cookie string for google

getUserAgent()   Sets the user-agent for subsequent requests

getWeightedBigram()   Returns the product of the avg value of all bigram pairs and the min bigram value in the sentence. Equivalent to ( but more efficient than): getBigramAvg(s) * getBigramMin(s)

getWeightedUnigram()   Returns the product of the count of the query and the # of words.

setGoogleCookie()   Sets the cookie string for subsequent requests

setUserAgent()   Returns the current user-agent

RiGoogler.isCacheEnabled()   Returns whethe the cache is enabled

RiGoogler.setCacheEnabled()   Sets whether the cache is enabled and duplicate requests are returned immediately rather than re-contacting google (default=true).

Usage Web & Application