|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
danbikel.switchboard.AbstractSwitchboardUser
danbikel.switchboard.AbstractClient
danbikel.parser.Parser
danbikel.parser.EMParser
public class EMParser
An EM parsing client. This class constrain-parses sentences by implementing the
AbstractClient.process(Object)
method of its superclass
. All top-level probabilities are
computed by a DecoderServer
object, which is either local
or is a stub whose methods are invoked via RMI. The actual
parsing is implemented in the EMDecoder
class.
AbstractClient
,
DecoderServer
,
EMDecoder
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class danbikel.switchboard.AbstractSwitchboardUser |
---|
AbstractSwitchboardUser.Alive, AbstractSwitchboardUser.SBUserRetry |
Field Summary |
---|
Fields inherited from class danbikel.parser.Parser |
---|
decoder, derivedDataFilename, err, grabSBSettings, inputFilename, internalInputFilename, internalOutputFilename, intTypeArr, invocationTargetExceptionMsg, keepAllWords, localServer, newDecoderTypeArr, numClients, outputFilename, outputFilenameSuffix, parserClass, sent, server, settingsFilename, standAlone, stringTypeArr, switchboardName |
Fields inherited from class danbikel.switchboard.AbstractClient |
---|
defaultNextObjectInterval, failover, faultTolerant, nextObjectInterval, rand, retries, serverId, sleepTime |
Fields inherited from class danbikel.switchboard.AbstractSwitchboardUser |
---|
aliveSynch, aliveTimeout, defaultMaxSwitchboardTries, defaultTimeout, dieSynch, id, infiniteTries, maxSwitchboardTries, registered, switchboard, timeout, timeToDie |
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
EMParser(DecoderServerRemote server)
Constructs a new EM parsing client using the specified DecoderServerRemote instance for probability lookups and for other
resources needed by the decoder. |
|
EMParser(int timeout)
Constructs an EM parsing client with the specified socket timeout value. |
|
EMParser(int timeout,
int port)
Construct an EM parsing client with the specified socket timeout value using the specified port on which to accept RMI connections. |
|
EMParser(int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
Constructs an EM parsing client using the specified port on which to accept RMI connections and using the specified socket factories for client and server socket creation. |
|
EMParser(String derivedDataFilename)
Constructs a new EM parsing client with an internal DecoderServerRemote instance constructed using the specified derived data
filename. |
Method Summary | |
---|---|
protected Decoder |
getNewDecoder(int id,
DecoderServerRemote server)
Gets a new Decoder instance that uses the specified DecoderServerRemote instance. |
static void |
main(String[] args)
Contacts the switchboard, registers this parsing client and gets sentences from the switchboard, parses them and returns them, until the switchboard indicates there are no more sentences to process. |
CountsTable |
parseAndCollectEventCounts(SexpList sent)
Collect expected counts for the specified partial parse tree/sentence. |
protected SexpList |
preProcess(Sexp tree)
Instead of simply invoking the Training.preProcess(Sexp) method,
this method selectively invokes only some of the preprocessing methods of
Training , so as to leave the rest of the transformations
unconstrained. |
protected Object |
process(Object obj)
Collect expected counts for the specified partial parse tree/sentence. |
Methods inherited from class danbikel.parser.Parser |
---|
checkSettings, convertUnknownWords, getConstraintsFromTree, getFailover, getFile, getFile, getNewDecoderServer, getNewParser, getNewParser, getRetries, getRetrySleep, getServer, getTagLists, getTagListsFromTree, getTimeout, getWords, getWordsFromTree, getWordsFromTree, parse, processInputFile, run, sentContainsWordsAndTags, setInternalFilenames, setSettingsFromSwitchboard, switchboardFailure, tolerateFaults, update, wordTagList |
Methods inherited from class danbikel.switchboard.AbstractClient |
---|
cleanup, disableHttp, getFaultTolerantServer, processObjects, processObjectsThenDie, register, reRegister, serverDown, setNextObjectInterval, setPolicyFile, setPolicyFile, sleepRandom |
Methods inherited from class danbikel.switchboard.AbstractSwitchboardUser |
---|
alive, die, disableHttp, getAliveTimeout, getSwitchboard, getSwitchboard, getSwitchboard, getSwitchboard, getSwitchboard, getSwitchboard, host, id, nonZeroTimeout, setPolicyFile, setPolicyFile, startAliveThread, unexportWhenDead |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface danbikel.switchboard.Client |
---|
serverDown |
Methods inherited from interface danbikel.switchboard.SwitchboardUser |
---|
alive, die, host, id |
Constructor Detail |
---|
public EMParser(String derivedDataFilename) throws RemoteException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException
DecoderServerRemote
instance constructed using the specified derived data
filename.
derivedDataFilename
- the derived data filename (output by the Trainer
) to use for constructing an internal
DecoderServerRemote
instance
RemoteException
- if this method is called from a remote stub
and any of the other exceptions are thrown
ClassNotFoundException
- if the class specified by Settings.decoderServerClass
is not found in
this JVM's class path
NoSuchMethodException
- if the class specified by Settings.decoderServerClass
has no
constructor taking a single String
as an argument
InvocationTargetException
- if the constructor of the class specified by
Settings.decoderServerClass
(the
invocation target) throws an underlying
exception
IllegalAccessException
- if the constructor of the class specified by
Settings.decoderServerClass
is not
accessible from this class in this package
InstantiationException
- if the class specified by Settings.decoderServerClass
is not
instantiable because it is either an
interface or abstract classpublic EMParser(DecoderServerRemote server) throws RemoteException
DecoderServerRemote
instance for probability lookups and for other
resources needed by the decoder.
server
- the server for this client's Decoder
to use
RemoteException
public EMParser(int timeout) throws RemoteException
timeout
- the time in milliseconds before client-side
(switchboard-side) sockets used for this remote object time
out; a value of 0 specifies infinite timeout, which
is dangerous
RemoteException
public EMParser(int timeout, int port) throws RemoteException
timeout
- the time in milliseconds before client-side
(switchboard-side) sockets used for this remote object time out;
a value of 0 specifies infinite timeout, which is
dangerousport
- the port on which this remote object is to receive
remote method invocations
RemoteException
public EMParser(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException
port
- the port on which this remote object is to receive
remote method invocationscsf
- the socket factory for creating sockets for this RMI clientssf
- the socket factory for creating sockets for this RMI server
RemoteException
Method Detail |
---|
protected Decoder getNewDecoder(int id, DecoderServerRemote server)
Decoder
instance that uses the specified DecoderServerRemote
instance.
getNewDecoder
in class Parser
id
- the id of this parsing clientserver
- the decoding server that the new decoder will use
Decoder
instance that uses the specified DecoderServerRemote
instanceprotected Object process(Object obj) throws RemoteException
process
in class Parser
obj
- a SexpList
that is in one of the three formats accepted
by the decoder, but normally should be a (partial) parse tree
from which constraints will be derived
CountsTable
instance containing a mapping of all
top-level (i.e., maximal context) events (of type TrainerEvent
)
to their expected counts under the current model
RemoteException
Parser.parse(SexpList)
public CountsTable parseAndCollectEventCounts(SexpList sent) throws RemoteException
sent
- a list that is in one of the three formats accepted by the
decoder, but normally should be a (partial) parse tree from
which constraints will be derived
TrainerEvent
) to their expected counts under the current
model
RemoteException
protected SexpList preProcess(Sexp tree)
Training.preProcess(Sexp)
method,
this method selectively invokes only some of the preprocessing methods of
Training
, so as to leave the rest of the transformations
unconstrained.
tree
- the tree to be preprocessed
public static void main(String[] args)
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |