|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
info.ephyra.search.searchers.Searcher
info.ephyra.search.searchers.KnowledgeAnnotator
info.ephyra.search.searchers.WorldFactbookKA
public class WorldFactbookKA
A KnowledgeAnnotator for the CIA World Factbook. It answers a
question about a country by extracting the information from the web page for
that country.
It runs as a separate thread, so several queries can be performed in parallel.
This class extends the class KnowledgeAnnotator.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private java.util.Hashtable<java.lang.String,java.lang.String> |
countries
Country names and corresponding web pages. |
private static java.lang.String |
URL
The URL of the CIA World Factbook. |
| Fields inherited from class info.ephyra.search.searchers.KnowledgeAnnotator |
|---|
index, matcher, name, qContents, qPatterns |
| 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 | |
|---|---|
|
WorldFactbookKA(java.lang.String filename)
Creates a WorldFactbookKA and calls the constructor of
the superclass that reads the question patterns from a file. |
protected |
WorldFactbookKA(java.lang.String name,
java.util.ArrayList<java.util.regex.Pattern> qPatterns,
java.util.ArrayList<java.lang.String> qContents)
Protected constructor used by the getCopy() method. |
| Method Summary | |
|---|---|
protected Result[] |
doSearch()
Searches the World Factbook for country details and returns an array containing a single Result object or an empty array, if the
search failed. |
KnowledgeAnnotator |
getCopy()
Returns a new instance of WorldFactbookKA. |
| Methods inherited from class info.ephyra.search.searchers.KnowledgeAnnotator |
|---|
getContent, getKAName, getResult, matches, 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 |
|---|
private static final java.lang.String URL
private java.util.Hashtable<java.lang.String,java.lang.String> countries
| Constructor Detail |
|---|
protected WorldFactbookKA(java.lang.String name,
java.util.ArrayList<java.util.regex.Pattern> qPatterns,
java.util.ArrayList<java.lang.String> qContents)
getCopy() method.
name - name of the KnowledgeAnnotatorqPatterns - question patternsqContents - descriptors of the relevant content of a question
public WorldFactbookKA(java.lang.String filename)
throws java.io.IOException
Creates a WorldFactbookKA and calls the constructor of
the superclass that reads the question patterns from a file.
Furthermore, a list of the available countries and the URLs of the corresponding web pages are retrieved from the Factbook.
filename - file containing the question patterns
java.io.IOException| Method Detail |
|---|
protected Result[] doSearch()
Result object or an empty array, if the
search failed.
doSearch in class SearcherResult or an empty arraypublic KnowledgeAnnotator getCopy()
WorldFactbookKA. A new instance is
created for each query.
getCopy in class KnowledgeAnnotatorWorldFactbookKA
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||