org.pandora.sense.http
Class Wiktionary

java.lang.Object
  extended by org.pandora.sense.BasicSense
      extended by org.pandora.sense.http.Http
          extended by org.pandora.sense.http.Wiktionary
All Implemented Interfaces:
Sense, DiscoverySense

public class Wiktionary
extends Http
implements DiscoverySense

Process Wikimedia Wiktionary pages.


Field Summary
 
Fields inherited from class org.pandora.sense.http.Http
WORKER_THREADS
 
Fields inherited from class org.pandora.sense.BasicSense
DEFAULT_SPEAKER, RETRY
 
Constructor Summary
Wiktionary()
           
 
Method Summary
 void awake()
          Start sensing.
 boolean discover(Vertex input, Network network, Vertex currentTime)
          Attempt to discover information on the vertex.
 void output(Vertex output)
          Post, process the post request.
 void processCategory(java.util.List<java.lang.String> category, org.w3c.dom.Node node, java.net.URL url, Network network)
          Process Wiktionary category page.
 void processRoot(org.w3c.dom.Node node, java.net.URL url, Network network)
          Process the XHTML DOM.
 void quickProcessWord(java.lang.String wordText, java.util.List<java.lang.String> categoryText, Network network)
          Bypass loading the word's page, and just define it from the category info.
 
Methods inherited from class org.pandora.sense.http.Http
batchProcessURL, convertToXHTML, findNextTag, findTag, findTag, findTag, getAllBullets, getAllURLBullets, getDomains, getHtmlCleaner, getNextBulletList, getParser, getSentence, getText, input, input, nextNode, parseURL, parseXHTML, processHeaders
 
Methods inherited from class org.pandora.sense.BasicSense
getEmotionalState, getLanguageState, getName, getPandora, getPrimitive, getShortTermMemory, initialize, input, isEnabled, log, log, log, setEmotionalState, setIsEnabled, setLanguageState, setName, setPandora, shutdown, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pandora.api.sense.Sense
getLanguageState, getName, getPandora, getPrimitive, initialize, input, input, isEnabled, setEmotionalState, setIsEnabled, setLanguageState, setName, setPandora, shutdown
 

Constructor Detail

Wiktionary

public Wiktionary()
Method Detail

awake

public void awake()
Description copied from class: BasicSense
Start sensing.

Specified by:
awake in interface Sense
Overrides:
awake in class BasicSense

processCategory

public void processCategory(java.util.List<java.lang.String> category,
                            org.w3c.dom.Node node,
                            java.net.URL url,
                            Network network)
Process Wiktionary category page. Parse the pages in the category, and lookup and parse each page.


processRoot

public void processRoot(org.w3c.dom.Node node,
                        java.net.URL url,
                        Network network)
Process the XHTML DOM. Determine the word, is it a noun or verb, associate synonyms.

Overrides:
processRoot in class Http

quickProcessWord

public void quickProcessWord(java.lang.String wordText,
                             java.util.List<java.lang.String> categoryText,
                             Network network)
Bypass loading the word's page, and just define it from the category info.


output

public void output(Vertex output)
Post, process the post request.

Specified by:
output in interface Sense
Overrides:
output in class Http

discover

public boolean discover(Vertex input,
                        Network network,
                        Vertex currentTime)
Attempt to discover information on the vertex.

Specified by:
discover in interface DiscoverySense