Parsing Engine

danbikel.parser
Class PriorEvent

java.lang.Object
  extended by danbikel.parser.PriorEvent
All Implemented Interfaces:
TrainerEvent, Serializable, Cloneable

public class PriorEvent
extends Object
implements TrainerEvent, Cloneable

A class to represent the marginal probabilities of lexicalized nonterminals (loosely, if incorrectly, referred to as “prior probabilities”).

See Also:
Serialized Form

Constructor Summary
PriorEvent(Word headWord, Symbol label)
          Constructs a new PriorEvent object, setting all its data members to the specified values.
 
Method Summary
 Object clone()
          Returns a deep copy of this object.
 TrainerEvent copy()
          Returns a deep copy of this object.
 boolean equals(Object obj)
          Returns whether the specified object is also an instance of this class and is equal to this object.
 int hashCode()
          Returns a hash code for this object.
 Word headWord()
          Returns the head word of this event.
 Symbol history()
          Returns the same symbol for all instances of this class, so that priors may be computed via the same mechanism as conditional probabilities: if the conditioning context is the same for all events counted, then the MLEs for those conditional events are the same as would be the MLEs for the prior probabilities of the predicted events.
 Symbol label()
          Returns the nonterminal label of this event.
 Word modHeadWord()
          Returns null.
 Symbol parent()
          Returns null.
 void set(Word headWord, Symbol label)
          Sets the head word and nonterminal label (all the data members) of this event.
 void setHeadWord(Word headWord)
          Sets the head word of this event.
 TrainerEvent shallowCopy()
          Returns a shallow copy of this object.
 boolean side()
          Throws an UnsupportedOperationException, as this is not a modifier event.
 String toString()
          Returns an S-expression string representation of the data in this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PriorEvent

public PriorEvent(Word headWord,
                  Symbol label)
Constructs a new PriorEvent object, setting all its data members to the specified values.

Parameters:
headWord - the head word
label - the unlexicalized nonterminal label
Method Detail

headWord

public Word headWord()
Returns the head word of this event.

Specified by:
headWord in interface TrainerEvent

label

public Symbol label()
Returns the nonterminal label of this event.


history

public Symbol history()
Returns the same symbol for all instances of this class, so that priors may be computed via the same mechanism as conditional probabilities: if the conditioning context is the same for all events counted, then the MLEs for those conditional events are the same as would be the MLEs for the prior probabilities of the predicted events. That is, when computing MLEs via counting, P(X | Y) = P_prior(X) if Y is always the same.


parent

public Symbol parent()
Returns null.

Specified by:
parent in interface TrainerEvent

modHeadWord

public Word modHeadWord()
Returns null.

Specified by:
modHeadWord in interface TrainerEvent

set

public void set(Word headWord,
                Symbol label)
Sets the head word and nonterminal label (all the data members) of this event.

Parameters:
headWord - the head word
label - the nontemrinal label

setHeadWord

public void setHeadWord(Word headWord)
Sets the head word of this event.

Specified by:
setHeadWord in interface TrainerEvent
Parameters:
headWord - the head word

side

public boolean side()
Throws an UnsupportedOperationException, as this is not a modifier event.

Specified by:
side in interface TrainerEvent
Throws:
UnsupportedOperationException - because this is not a modifier event

equals

public boolean equals(Object obj)
Returns whether the specified object is also an instance of this class and is equal to this object.

Overrides:
equals in class Object
Parameters:
obj - the object to compare with this object
Returns:
whether the specified object is also an instance of this class and is equal to this object

toString

public String toString()
Returns an S-expression string representation of the data in this object.

Overrides:
toString in class Object
Returns:
an S-expression string representation of the data in this object.

hashCode

public int hashCode()
Returns a hash code for this object.

Overrides:
hashCode in class Object
Returns:
a hash code for this object.

clone

public Object clone()
Returns a deep copy of this object.

Overrides:
clone in class Object

copy

public TrainerEvent copy()
Returns a deep copy of this object.

Specified by:
copy in interface TrainerEvent

shallowCopy

public TrainerEvent shallowCopy()
Returns a shallow copy of this object.

Specified by:
shallowCopy in interface TrainerEvent

Parsing Engine

Author: Dan Bikel.