Parsing Engine

danbikel.parser
Class BaseNPAwareShifter

java.lang.Object
  extended by danbikel.parser.BaseNPAwareShifter
All Implemented Interfaces:
Shift

public class BaseNPAwareShifter
extends Object
implements Shift

An implementation of the Shift interface that does not shift punctuation into the history when the current parent node label is that of a base NP.

See Also:
Treebank.isBaseNP(Symbol), Treebank.isPunctuation(Symbol)

Constructor Summary
BaseNPAwareShifter()
          Constructs an instance of this base NP–aware shifter.
 
Method Summary
 void shift(TrainerEvent event, SexpList list, Sexp prevMod)
          The previous modifier is not shifted into the history if the current parent (as determined by TrainerEvent.parent()) is a base NP and the previous modifier is punctuation.
 void shift(TrainerEvent event, WordList wordList, Word prevWord)
          The head word of the previous modifier is not shifted into the history if the current parent (as determined by TrainerEvent.parent()) is a base NP and the previous modifier is punctuation.
 boolean skip(Item item, Sexp prevMod)
          The previous modifier is skipped (not included in the construction of the history) if the current parent (as determined by CKYItem.label()) is a base NP and the previous modifier is punctuation.
 boolean skip(Item item, Word prevWord)
          The head word of the previous modifier is skipped (not included in the construction of the history) ifthe current parent (as determined by CKYItem.label()) is a base NP and the previous modifier is punctuation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseNPAwareShifter

public BaseNPAwareShifter()
Constructs an instance of this base NP–aware shifter.

Method Detail

shift

public void shift(TrainerEvent event,
                  SexpList list,
                  Sexp prevMod)
The previous modifier is not shifted into the history if the current parent (as determined by TrainerEvent.parent()) is a base NP and the previous modifier is punctuation.

Specified by:
shift in interface Shift
Parameters:
event - the TrainerEvent whose history is to be updated
list - the current history of previously-generated modifiers
prevMod - the previously-generated modifier
See Also:
Treebank.isBaseNP(Symbol), Treebank.isPunctuation(Symbol)

shift

public void shift(TrainerEvent event,
                  WordList wordList,
                  Word prevWord)
The head word of the previous modifier is not shifted into the history if the current parent (as determined by TrainerEvent.parent()) is a base NP and the previous modifier is punctuation.

Specified by:
shift in interface Shift
Parameters:
event - the TrainerEvent whose history is to be updated
wordList - the current history of previously-generated modifier head words
prevWord - the head word of the previously-generated modifier
See Also:
Treebank.isBaseNP(Symbol), Treebank.isPunctuation(Symbol)

skip

public boolean skip(Item item,
                    Sexp prevMod)
The previous modifier is skipped (not included in the construction of the history) if the current parent (as determined by CKYItem.label()) is a base NP and the previous modifier is punctuation.

Specified by:
skip in interface Shift
Parameters:
item - the CKYItem object whose history is being constructed
prevMod - the previously-generated modifier
Returns:
whether or not to skip the specified previous modifier when constructing the modifier history for the specified chart item
See Also:
Treebank.isBaseNP(Symbol), Treebank.isPunctuation(Symbol)

skip

public boolean skip(Item item,
                    Word prevWord)
The head word of the previous modifier is skipped (not included in the construction of the history) ifthe current parent (as determined by CKYItem.label()) is a base NP and the previous modifier is punctuation.

Specified by:
skip in interface Shift
Parameters:
item - the CKYItem object whose history is being constructed
prevWord - the head word of the previously-generated modifier
Returns:
whether or not to skip the specified previous modifier's head word when constructing the modifier head word history for the specified chart item
See Also:
Treebank.isBaseNP(Symbol), Treebank.isPunctuation(Symbol)

Parsing Engine

Author: Dan Bikel.