|
||||||||||
| 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.WikipediaKA
public class WikipediaKA
A KnowledgeAnnotator for the Wikipedia online encyclopedia.
It answers a question for a definition by returning a sentence from the
corresponding Wikipedia web page.
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 static java.lang.String |
URL
The URL of the Wikipedia search page. |
| 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 | |
|---|---|
|
WikipediaKA(java.lang.String filename)
Creates a WikipediaKA and calls the constructor of the
superclass that reads the question patterns from a file. |
protected |
WikipediaKA(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()
Queries Wikipedia for a definition and returns an array containing a single Result object or an empty array, if the search
failed. |
KnowledgeAnnotator |
getCopy()
Returns a new instance of WikipediaKA. |
| 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
| Constructor Detail |
|---|
protected WikipediaKA(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 WikipediaKA(java.lang.String filename)
throws java.io.IOException
WikipediaKA and calls the constructor of the
superclass that reads the question patterns from a file.
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()
WikipediaKA. A new instance is
created for each query.
getCopy in class KnowledgeAnnotatorWikipediaKA
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||