websphinx.searchengine
Class NewsBot

java.lang.Object
  |
  +--websphinx.searchengine.NewsBot
All Implemented Interfaces:
Classifier, SearchEngine, java.io.Serializable

public class NewsBot
extends java.lang.Object
implements SearchEngine

NewsBot search engine.


Field Summary
static float priority
          Priority of this classifier.
 
Constructor Summary
NewsBot()
           
 
Method Summary
 void classify(Page page)
          Classify a page.
 float getPriority()
          Get priority of this classifier.
 int getResultsPerPage()
          Get number of results per page for this search engine.
 java.net.URL makeQuery(java.lang.String keywords)
          Make a query URL for NewsBot.
static Search search(java.lang.String keywords)
          Search NewsBot.
static Search search(java.lang.String keywords, int maxResults)
          Search NewsBot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

priority

public static final float priority
Priority of this classifier.

Constructor Detail

NewsBot

public NewsBot()
Method Detail

classify

public void classify(Page page)
Classify a page. Sets the following labels:
Name Type Meaning
searchengine.source Page label NewsBot object that labeled this page
searchengine.count Page field Number of results on page
searchengine.results Page fields Array of results. Each result region contains subfields: rank, title, description, and link.
searchengine.more-results Link label Link to a page containing more results.

Specified by:
classify in interface Classifier
Following copied from interface: websphinx.Classifier
Parameters:
page - Page to classify

getPriority

public float getPriority()
Get priority of this classifier.

Specified by:
getPriority in interface Classifier
Returns:
priority.

makeQuery

public java.net.URL makeQuery(java.lang.String keywords)
Make a query URL for NewsBot.

Specified by:
makeQuery in interface SearchEngine
Parameters:
keywords - list of keywords, separated by spaces
Returns:
URL that submits the keywords to NewsBot.

getResultsPerPage

public int getResultsPerPage()
Get number of results per page for this search engine.

Specified by:
getResultsPerPage in interface SearchEngine
Returns:
typical number of results per page

search

public static Search search(java.lang.String keywords)
Search NewsBot.

Parameters:
keywords - list of keywords, separated by spaces
Returns:
enumeration of SearchEngineResults returned by a NewsBot query constructed from the keywords.

search

public static Search search(java.lang.String keywords,
                            int maxResults)
Search NewsBot.

Parameters:
keywords - list of keywords, separated by spaces
maxResults - maximum number of results to return
Returns:
enumeration of SearchEngineResults returned by an NewsBot query constructed from the keywords. The enumeration yields at most maxResults objects.