|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.ModifierEvent
public class ModifierEvent
A class to represent the modifier generation event implicit in the models
supported by this parsing package. The class Trainer
counts
such events, from which other events are derived.
Constructor Summary | |
---|---|
ModifierEvent(Sexp sexp)
Constructs a new object from the specified S-expression. |
|
ModifierEvent(Word modHeadWord,
Word headWord,
Symbol modifier,
SexpList previousMods,
WordList previousWords,
Symbol parent,
Symbol head,
SexpList subcat,
boolean verbIntervening,
boolean side)
Constructs a new ModifierEvent object, settings its
data members to the values specified. |
|
ModifierEvent(Word modHeadWord,
Word headWord,
Symbol modifier,
SexpList previousMods,
WordList previousWords,
Symbol parent,
Symbol head,
Subcat subcat,
boolean verbIntervening,
boolean side)
Constructs a new ModifierEvent object, settings its
data members to the values specified. |
|
ModifierEvent(Word modHeadWord,
Word headWord,
Symbol modifier,
SexpList previousMods,
WordList previousWords,
Symbol parent,
Symbol head,
Subcat subcat,
Word prevPunc,
Word prevConj,
boolean isConjPConj,
boolean verbIntervening,
boolean headAdjacent,
boolean side)
Constructs a new ModifierEvent object for use when
outputting training events in the format of Mike Collins’ parser,
settings its data members to the values specified. |
Method Summary | |
---|---|
Object |
clone()
Returns a deep copy of this object. |
TrainerEvent |
copy()
Returns a deep copy of this object. |
boolean |
equals(Object o)
Returns true if the specified object is an instance of
a ModifierEvent object containing data members which are all
pairwise-equal with the data members of this ModifierEvent
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 child nonterminal label. |
boolean |
headAdjacent()
Returns whether the current modifier is adjacent to the head child. |
Word |
headWord()
Returns the head word of the head child being modified. |
boolean |
isConjPConj()
Returns the boolean that indicates whether the modifier is a conjunction that is part of a conjunction phrase. |
Word |
modHeadWord()
Returns the head word of the modifier of this modifier event. |
Symbol |
modifier()
Returns the nonterminal label of this modifier event. |
Symbol |
parent()
Returns the parent nonterminal label. |
Word |
prevConj()
Returns the previously-generated conjunction if this modifier is conjoined with the head of the phrase, or null if this modifier is
not conjoined. |
SexpList |
previousMods()
Returns a list of modifiers that have already been generated. |
WordList |
previousWords()
Returns a list of the head words of modifiers that have already been generated. |
Word |
prevPunc()
Returns the previously-generated punctuation word if this modifier follows one, or null . |
void |
setHeadWord(Word headWord)
Sets the head word of the head child and parent. |
void |
setModHeadWord(Word modHeadWord)
Sets the head word of the modifier. |
void |
setPreviousWords(WordList previousWords)
Sets the previous words list. |
TrainerEvent |
shallowCopy()
Returns a shallow copy of this event. |
boolean |
side()
Returns the value of Constants.LEFT if this modifier lies on the
left side of the head child, or the value of Constants.RIGHT if
this modifier lies on the right side. |
Subcat |
subcat()
Returns a list of arguments of the head child that have yet to be generated. |
String |
toString()
Returns an S-expression of the form accepted by ModifierEvent(Sexp) . |
boolean |
verbIntervening()
Returns whether a verb has been generated in any of the subtrees generated between the current modifier and the head child. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ModifierEvent(Sexp sexp)
Sexp
must be an instance of a list with the following format:
(modHeadWord headWord modifier previousMods parent head subcat verbIntervening side)where
Word.Word(Sexp)
Word.Word(Sexp)
Constants.trueSym
,
Constants.falseSym
}
Constants.leftSym
,
Constants.rightSym
}
public ModifierEvent(Word modHeadWord, Word headWord, Symbol modifier, SexpList previousMods, WordList previousWords, Symbol parent, Symbol head, SexpList subcat, boolean verbIntervening, boolean side)
ModifierEvent
object, settings its
data members to the values specified.
modHeadWord
- the head word of the modifying nonterminal of this
modifier eventheadWord
- the head word of the head child being modifiedmodifier
- the nonterminal label of the modifierpreviousMods
- a list of previous modifying nonterminal labelsparent
- the parent nonterminal labelhead
- the head child nonterminal labelsubcat
- an ordered list of arguments of the head that have yet to
be generatedverbIntervening
- a boolean representing whether or a not a verb
has been generated anywhere in the subtrees between the head child
and the current modifierside
- a boolean that is equal to Constants.LEFT
if this
modifier lies on the left side of the head child or equal to
Constants.RIGHT
if this modifier lies on the right sidepublic ModifierEvent(Word modHeadWord, Word headWord, Symbol modifier, SexpList previousMods, WordList previousWords, Symbol parent, Symbol head, Subcat subcat, boolean verbIntervening, boolean side)
ModifierEvent
object, settings its
data members to the values specified.
modHeadWord
- the head word of the modifying nonterminal of this
modifier eventheadWord
- the head word of the head child being modifiedmodifier
- the nonterminal label of the modifierpreviousMods
- a list of previous modifying nonterminal labelsparent
- the parent nonterminal labelhead
- the head child nonterminal labelsubcat
- a set of arguments on the specified side of the head that
have yet to be generatedverbIntervening
- a boolean representing whether or a not a verb
has been generated anywhere in the subtrees between the head child
and the current modifierside
- a boolean that is equal to Constants.LEFT
if this
modifier lies on the left side of the head child or equal to
Constants.RIGHT
if this modifier lies on the right sidepublic ModifierEvent(Word modHeadWord, Word headWord, Symbol modifier, SexpList previousMods, WordList previousWords, Symbol parent, Symbol head, Subcat subcat, Word prevPunc, Word prevConj, boolean isConjPConj, boolean verbIntervening, boolean headAdjacent, boolean side)
ModifierEvent
object for use when
outputting training events in the format of Mike Collins’ parser,
settings its data members to the values specified.
modHeadWord
- the head word of the modifying nonterminal of this
modifier eventheadWord
- the head word of the head child being modifiedmodifier
- the nonterminal label of the modifierpreviousMods
- a list of previous modifying nonterminal labelsparent
- the parent nonterminal labelhead
- the head child nonterminal labelsubcat
- a set of arguments on the specified side of the head that
have yet to be generatedprevPunc
- the previously-generated punctuation word or
null
if the last modifier was neither punctuation nor
a conjunctionprevConj
- the previously-generated conjunction or null
if the last modifier was neither punctuation nor a conjunctionisConjPConj
- indicates whether the previously-generated modifier
was a conjunction that was part of a conjoined phrase as per
the definitions of Mike Collins’ modelverbIntervening
- a boolean representing whether or a not a verb
has been generated anywhere in the subtrees between the head child
and the current modifierheadAdjacent
- indicates whether the current modifier is adjacent
to the head childside
- a boolean that is equal to Constants.LEFT
if this
modifier lies on the left side of the head child or equal to
Constants.RIGHT
if this modifier lies on the right sideSettings.outputCollins
Method Detail |
---|
public Word modHeadWord()
modHeadWord
in interface TrainerEvent
public Word headWord()
headWord
in interface TrainerEvent
public Symbol modifier()
public SexpList previousMods()
public WordList previousWords()
public Symbol parent()
parent
in interface TrainerEvent
public Symbol head()
public Subcat subcat()
public Word prevPunc()
null
.
public Word prevConj()
null
if this modifier is
not conjoined.
public boolean isConjPConj()
public boolean verbIntervening()
public boolean headAdjacent()
Settings.outputCollins
public boolean side()
Constants.LEFT
if this modifier lies on the
left side of the head child, or the value of Constants.RIGHT
if
this modifier lies on the right side.
side
in interface TrainerEvent
public void setModHeadWord(Word modHeadWord)
modHeadWord
- the head word of the modifierpublic void setHeadWord(Word headWord)
setHeadWord
in interface TrainerEvent
headWord
- the head wordpublic void setPreviousWords(WordList previousWords)
previousWords
- the previous words listpublic boolean equals(Object o)
true
if the specified object is an instance of
a ModifierEvent
object containing data members which are all
pairwise-equal with the data members of this ModifierEvent
object, according to each data member's equals(Object)
method.
equals
in class Object
public String toString()
ModifierEvent(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()
shallowCopy
in interface TrainerEvent
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |