modnlp.tec.server
public class TecConnection extends java.lang.Thread
TecServer
,
TecCorpusFile
,
TecLogFile
,
Dictionary
,
FilePosStr
Constructor and Description |
---|
TecConnection(java.net.Socket s,
Dictionary d,
TecLogFile f,
HeaderDBManager h)
Initialize a new connection thread
|
Modifier and Type | Method and Description |
---|---|
void |
getCorpusDescription(Request req,
java.io.PrintWriter os) |
void |
getExtract(Request req,
java.io.PrintWriter os)
Retrieve a bit of text surrounding a given keyword
|
void |
getFreqList(Request req,
java.io.PrintWriter os)
Retrieve a (case-insensitive) frequency list
|
void |
getFreqWord(Request req,
java.io.PrintWriter os)
Retrieve the frequency of a keyword (possibly in a case-insensitive way).
|
void |
getHeaderBaseURL(java.io.PrintWriter os) |
void |
getTotalNoOfTokens(Request req,
java.io.PrintWriter os)
Retrieve the toal number of tokens in corpus
|
void |
run()
Wait for connections (forever) parse clients requests
and trigger the appropriate actions
|
activeCount, checkAccess, clone, 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
public TecConnection(java.net.Socket s, Dictionary d, TecLogFile f, HeaderDBManager h)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void getExtract(Request req, java.io.PrintWriter os)
req
- A pre-parsed client request (key-value pairs)os
- the output stream (to be received by client)Request
,
TecCorpusFile
public void getHeaderBaseURL(java.io.PrintWriter os)
public void getFreqList(Request req, java.io.PrintWriter os)
req
- A pre-parsed client request (key-value pairs)os
- the output stream (to be received by client)Request
,
TecCorpusFile
public void getFreqWord(Request req, java.io.PrintWriter os)
casesensitive
to indicate whether case
matters in searching for the keyword
, and
xquerywhere
to specify subcorpus search
constraints.req
- A pre-parsed client request (key-value pairs)os
- the output stream (to be received by client)Request
,
TecCorpusFile
public void getTotalNoOfTokens(Request req, java.io.PrintWriter os)
req
- A pre-parsed client request (key-value pairs)os
- the output stream (to be received by client)Request
,
TecCorpusFile
public void getCorpusDescription(Request req, java.io.PrintWriter os)