info.ephyra.search.searchers
Class YahooKM

java.lang.Object
  extended by java.lang.Thread
      extended by info.ephyra.search.searchers.Searcher
          extended by info.ephyra.search.searchers.KnowledgeMiner
              extended by info.ephyra.search.searchers.YahooKM
All Implemented Interfaces:
java.lang.Runnable

public class YahooKM
extends KnowledgeMiner

A KnowledgeMiner that deploys the Yahoo search engine to search the World Wide Web.

It runs as a separate thread, so several queries can be performed in parallel.

This class extends the class KnowledgeMiner.

Version:
2007-05-29
Author:
Nico Schlaefer

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private static int MAX_RESULTS_PERQUERY
          Maximum number of search results per query.
private static int MAX_RESULTS_TOTAL
          Maximum total number of search results.
private static int RETRIES
          Number of retries if search fails.
private static java.lang.String YAHOO_ID
          Yahoo application ID, allows 5,000 queries per day and IP address.
 
Fields inherited from class info.ephyra.search.searchers.KnowledgeMiner
firstResult, maxResults
 
Fields inherited from class info.ephyra.search.searchers.Searcher
query, results
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
YahooKM()
           
 
Method Summary
protected  Result[] doSearch()
          Queries the Yahoo search engine and returns an array containing up to MAX_RESULTS_PERQUERY search results.
 KnowledgeMiner getCopy()
          Returns a new instance of YahooKM.
protected  int getMaxResultsPerQuery()
          Returns the maximum number of search results per query.
protected  int getMaxResultsTotal()
          Returns the maximum total number of search results.
static java.lang.String transformQueryString(java.lang.String qs)
          Returns a representation of the query string that is suitable for Yahoo.
 
Methods inherited from class info.ephyra.search.searchers.KnowledgeMiner
getResults, getResults, start, start
 
Methods inherited from class info.ephyra.search.searchers.Searcher
run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

YAHOO_ID

private static final java.lang.String YAHOO_ID
Yahoo application ID, allows 5,000 queries per day and IP address.

See Also:
Constant Field Values

MAX_RESULTS_TOTAL

private static final int MAX_RESULTS_TOTAL
Maximum total number of search results.

See Also:
Constant Field Values

MAX_RESULTS_PERQUERY

private static final int MAX_RESULTS_PERQUERY
Maximum number of search results per query.

See Also:
Constant Field Values

RETRIES

private static final int RETRIES
Number of retries if search fails.

See Also:
Constant Field Values
Constructor Detail

YahooKM

public YahooKM()
Method Detail

transformQueryString

public static java.lang.String transformQueryString(java.lang.String qs)
Returns a representation of the query string that is suitable for Yahoo.

Parameters:
qs - query string
Returns:
query string for Yahoo

getMaxResultsTotal

protected int getMaxResultsTotal()
Returns the maximum total number of search results.

Specified by:
getMaxResultsTotal in class KnowledgeMiner
Returns:
maximum total number of search results

getMaxResultsPerQuery

protected int getMaxResultsPerQuery()
Returns the maximum number of search results per query.

Specified by:
getMaxResultsPerQuery in class KnowledgeMiner
Returns:
maximum total number of search results

doSearch

protected Result[] doSearch()
Queries the Yahoo search engine and returns an array containing up to MAX_RESULTS_PERQUERY search results.

Specified by:
doSearch in class Searcher
Returns:
Yahoo search results

getCopy

public KnowledgeMiner getCopy()
Returns a new instance of YahooKM. A new instance is created for each query.

Specified by:
getCopy in class KnowledgeMiner
Returns:
new instance of YahooKM