edu.princeton.wordnet.orm
Class WordNetClient

java.lang.Object
  extended by edu.princeton.wordnet.orm.WordNetClient
Direct Known Subclasses:
WordNetClientImpl

public abstract class WordNetClient
extends java.lang.Object

WordNet client

Author:
Bernard Bou

Field Summary
protected static java.lang.String theConnectionSettings
          Connection settings on command-line
private static WordNetClient theWordNetClient
          Singleton
 
Constructor Summary
WordNetClient()
           
 
Method Summary
static WordNetClient get()
          Get singleton client
abstract  java.lang.String[] getLexDomainNames()
          Get lexdomain names
abstract  java.lang.String[] getLinkNames()
          Get link names
abstract  java.util.Collection<edu.princeton.wordnet.pojos.Link> getLinks()
          Get links
abstract  java.lang.String[] getPosNames()
          Get pos names
protected  boolean isQuery(java.lang.String thisLookup)
          Check whether lookup expression is a SQL Query
static WordNetClient make(boolean JPA)
          Make client
protected  java.lang.String makeQuery(java.lang.String thisLookup)
          Extract query
abstract  org.dom4j.Document queryDoc(java.lang.String thisTarget)
          Query for document
abstract  java.util.Collection<org.dom4j.Element> queryElements(java.lang.String thisTarget)
          Query for collection of elements
abstract  org.dom4j.Document queryRawDoc(java.lang.String thisTarget)
          Query for document
abstract  javax.swing.tree.TreeModel queryTreeModel(java.lang.String thisTarget)
          Query (from tree model built from Pojos)
abstract  java.lang.String queryXML(java.lang.String thisTarget)
          Query for XML
abstract  javax.swing.tree.TreeModel queryXmlTreeModel(java.lang.String thisTarget)
          Query (from tree model built from element-returning call)
static java.lang.Object[] reduce(java.util.Collection<? extends java.lang.Object> thisCollection, java.lang.String thisMethodName)
          Reduce collection by calling no-argument method
static void set(WordNetClient thisWordNetClient)
          Set singleton
static void setPrintStream(java.io.OutputStream thisOutputStream)
          Set print stream for SQL queries output
static void setup(java.lang.String[] theseArgs)
          Setup hook
abstract  void shutdown()
          Shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theWordNetClient

private static WordNetClient theWordNetClient
Singleton


theConnectionSettings

protected static java.lang.String theConnectionSettings
Connection settings on command-line

Constructor Detail

WordNetClient

public WordNetClient()
Method Detail

set

public static void set(WordNetClient thisWordNetClient)
Set singleton

Parameters:
thisWordNetClient - client

make

public static WordNetClient make(boolean JPA)
                          throws java.lang.Exception
Make client

Returns:
wordnet client
Throws:
java.lang.Exception

get

public static WordNetClient get()
Get singleton client

Returns:
client

setup

public static void setup(java.lang.String[] theseArgs)
Setup hook

Parameters:
theseArgs - command line arguments

setPrintStream

public static void setPrintStream(java.io.OutputStream thisOutputStream)
Set print stream for SQL queries output

Parameters:
thisOutputStream - output stream

shutdown

public abstract void shutdown()
Shutdown


queryElements

public abstract java.util.Collection<org.dom4j.Element> queryElements(java.lang.String thisTarget)
                                                               throws java.lang.Exception
Query for collection of elements

Parameters:
thisTarget - target
Returns:
collection of dom4j elements
Throws:
java.lang.Exception

queryDoc

public abstract org.dom4j.Document queryDoc(java.lang.String thisTarget)
                                     throws java.lang.Exception
Query for document

Parameters:
thisTarget - word to look up
Returns:
DOM Document
Throws:
java.lang.Exception

queryRawDoc

public abstract org.dom4j.Document queryRawDoc(java.lang.String thisTarget)
                                        throws java.lang.Exception
Query for document

Parameters:
thisTarget - target
Returns:
DOM Document
Throws:
java.lang.Exception

queryXML

public abstract java.lang.String queryXML(java.lang.String thisTarget)
                                   throws java.lang.Exception
Query for XML

Parameters:
thisTarget - target
Returns:
XML string
Throws:
java.lang.Exception

queryXmlTreeModel

public abstract javax.swing.tree.TreeModel queryXmlTreeModel(java.lang.String thisTarget)
                                                      throws java.lang.Exception
Query (from tree model built from element-returning call)

Parameters:
thisTarget - target
Returns:
tree model
Throws:
java.lang.Exception

queryTreeModel

public abstract javax.swing.tree.TreeModel queryTreeModel(java.lang.String thisTarget)
                                                   throws java.lang.Exception
Query (from tree model built from Pojos)

Parameters:
thisTarget - target
Returns:
tree model
Throws:
java.lang.Exception

getPosNames

public abstract java.lang.String[] getPosNames()
                                        throws java.lang.Exception
Get pos names

Returns:
array of strings
Throws:
java.lang.Exception

getLexDomainNames

public abstract java.lang.String[] getLexDomainNames()
                                              throws java.lang.Exception
Get lexdomain names

Returns:
array of strings
Throws:
java.lang.Exception

getLinkNames

public abstract java.lang.String[] getLinkNames()
                                         throws java.lang.Exception
Get link names

Returns:
array of strings
Throws:
java.lang.Exception

getLinks

public abstract java.util.Collection<edu.princeton.wordnet.pojos.Link> getLinks()
                                                                         throws java.lang.Exception
Get links

Returns:
array of strings
Throws:
java.lang.Exception

isQuery

protected boolean isQuery(java.lang.String thisLookup)
Check whether lookup expression is a SQL Query

Parameters:
thisLookup - lookup expression
Returns:
true if lookup expresssion is a SQL query

makeQuery

protected java.lang.String makeQuery(java.lang.String thisLookup)
Extract query

Parameters:
thisLookup - lookup
Returns:
query

reduce

public static java.lang.Object[] reduce(java.util.Collection<? extends java.lang.Object> thisCollection,
                                        java.lang.String thisMethodName)
Reduce collection by calling no-argument method

Parameters:
thisCollection -
Returns:
array of objects