|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.GapEvent
public class GapEvent
A class to represent the gap generation event implicit in the models
supported by this parsing package. The class Trainer
counts
such events, from which other events are derived.
Field Summary | |
---|---|
static Symbol |
toHead
The symbol representing a gap passed from a parent to its head. |
static Symbol |
toLeft
The symbol representing a gap passed from a parent to one of the premodifiers of its head child. |
static Symbol |
toRight
The symbol representing a gap passed from a parent to one of the postmodifiers of its head child. |
Constructor Summary | |
---|---|
GapEvent(Sexp sexp)
Contructs a new object from the specified S-expression. |
|
GapEvent(Symbol direction,
Word headWord,
Symbol parent,
Symbol head)
Constructs a new GapEvent 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. |
Symbol |
direction()
Returns the direction of this gap event: one of { toHead ,
toLeft , toRight }. |
boolean |
equals(Object o)
Returns true if the specified object is an instance of
a GapEvent object containing data members which are all
pairwise-equal with the data members of this GapEvent
object, according to each data member's equals(Object) method. |
int |
hashCode()
Returns the hash code of this object, calculated from the hash codes of all its data members. |
Symbol |
head()
Returns the head nonterminal label. |
Word |
headWord()
Returns the head word. |
Word |
modHeadWord()
Returns null , as gap events do not deal with modifier words. |
Symbol |
parent()
Returns the parent nonterminal label. |
void |
setHeadWord(Word word)
Sets the head word of this event, or does nothing if this TrainerEvent has no such object. |
TrainerEvent |
shallowCopy()
Returns a shallow copy of this event of the same run-time type. |
boolean |
side()
Throws an UnsupportedOperationException , as this is not
a modifier event. |
String |
toString()
Returns an S-expression of the form accepted by GapEvent(Sexp) . |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Symbol toHead
public static final Symbol toLeft
public static final Symbol toRight
Constructor Detail |
---|
public GapEvent(Sexp sexp)
Sexp
must be an instance of a list with the
following format:
(direction headWord parent head)where
toHead
, toLeft
,
toRight
}
Word.Word(Sexp)
sexp
- a list containing all the information necessary to
construct this HeadEvent
objectpublic GapEvent(Symbol direction, Word headWord, Symbol parent, Symbol head)
GapEvent
object, setting all its
data members to the specified values.
direction
- a symbol specifying the direction of the gap (trace)
relative to the head child; this symbol must be one of {toHead
,
toLeft
, toRight
}headWord
- the head wordparent
- the parent nonterminal labelhead
- the head nonterminal labelMethod Detail |
---|
public Symbol direction()
toHead
,
toLeft
, toRight
}.
public Symbol head()
public Word headWord()
headWord
in interface TrainerEvent
public Symbol parent()
parent
in interface TrainerEvent
public Word modHeadWord()
null
, as gap events do not deal with modifier words.
modHeadWord
in interface TrainerEvent
public boolean side()
UnsupportedOperationException
, as this is not
a modifier event.
side
in interface TrainerEvent
UnsupportedOperationException
- because this is not a modifier
eventpublic void setHeadWord(Word word)
TrainerEvent
TrainerEvent
has no such object.
setHeadWord
in interface TrainerEvent
word
- the word to set as the head word of this eventpublic boolean equals(Object o)
true
if the specified object is an instance of
a GapEvent
object containing data members which are all
pairwise-equal with the data members of this GapEvent
object, according to each data member's equals(Object)
method.
equals
in class Object
public String toString()
GapEvent(Sexp)
.
toString
in class Object
public int hashCode()
hashCode
in class Object
public Object clone()
clone
in class Object
public TrainerEvent copy()
copy
in interface TrainerEvent
public TrainerEvent shallowCopy()
TrainerEvent
shallowCopy
in interface TrainerEvent
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |